Skip to content

Unable to open SSL / HTTPS socket with ESP8266: OSError from ssl.wrap_socket #413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
joseph-long opened this issue Feb 3, 2021 · 2 comments

Comments

@joseph-long
Copy link

I've just set up an ESP8266 with 4MB of flash using esp8266-20210202-v1.14.bin and I'm trying to run some example code to open a socket for https:

import usocket
import ssl

hostname = 'xwcl.science'
s = usocket.socket()
ai = usocket.getaddrinfo(hostname, 443)
addr = ai[0][-1]
print(addr)
s.connect(addr)
s = ssl.wrap_socket(s)

In the REPL, it all goes well until ssl.wrap_socket:

>>> hostname = 'xwcl.science'
>>> s = usocket.socket()
>>> ai = usocket.getaddrinfo(hostname, 443)
>>> addr = ai[0][-1]
>>> print(addr)
('104.238.141.27', 443)
>>> s.connect(addr)
>>> s = ssl.wrap_socket(s)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: -40
@jonnor
Copy link

jonnor commented Aug 25, 2024

Hi. There has been many improvements to ESP8266 and ssl over the last years. Is this still a problem on latest MicroPython version?

@jonnor
Copy link

jonnor commented Aug 25, 2024

There is more information, including tests on recent MicroPython in #400
Proposing to close this issue in favor of that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants