-
Re: SSL connection IPProto_SEC error
Been trying to get this lib to work: https://github.com/Enabling/wipy-urllib/tree/master
But I get the same error as in the older forum entry:
AttributeError: 'module' object has no attribute 'IPPROTO_SEC'And as fare as I can read on the Git the code below is only for the WiPy 1
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_SEC)Any idea how to re-write the library to take this into account? Am using an SiPy.
-
@Lokefar
you can wrap socket by ssl
https://docs.pycom.io/pycom_esp32/library/ussl.html?highlight=sslthis is good start point for conversion
-
@livius Thanks. I was already having a look at that but my initial thought is that it is a bit beyond my comprehension ability to convert it.
-
@Lokefar
instead of:sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_SEC) sock.settimeout(5) s = ssl.wrap_socket(sock) s.connect(socket.getaddrinfo(host, port)[0][4])do (not tested but should be something simmilar)
sock = socket.socket() s = ssl.wrap_socket(sock) s.connect(socket.getaddrinfo(host, port)[0][-1]) -
@livius Did a quick try. Got the following error:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/flash/lib/urequests.py", line 141, in urlopen File "/flash/lib/urequests.py", line 38, in __init__ OSError: -32512Will look more into it later, but as fare as I can Google it might have something to do with the antenna transmission.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login