SSL Connection IPProto_SEC Error SiPy
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.
@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: -32512
Will look more into it later, but as fare as I can Google it might have something to do with the antenna transmission.
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))
do (not tested but should be something simmilar)
sock = socket.socket() s = ssl.wrap_socket(sock) s.connect(socket.getaddrinfo(host, port)[-1])
@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.
you can wrap socket by ssl
this is good start point for conversion