pfalcon / pycopy-lib

Standard library of the Pycopy project, minimalist and light-weight Python language implementation
https://github.com/pfalcon/pycopy
Other
246 stars 70 forks source link

urequest module error when calling a HTTPS url #66

Closed netomarin closed 3 years ago

netomarin commented 3 years ago

When executing a POST to an HTTPS endpoint, I get an error from the function request at line 88:

File "/lib/urequests/__init__.py", line 162, in post
File "/lib/urequests/__init__.py", line 88, in request
AttributeError: 'module' object has no attribute 'SSLContext'

Accordingo the ussl documentation, there is no such function ussl.SSLContext(), the only method listed there is wrap_socket which is called on line 89, but against the ctx reference instead.

pfalcon commented 3 years ago

pycopy-lib is part of Pycopy ecosystem, please see https://github.com/pfalcon/pycopy-lib (description, README) regarding requirements needed to use pycopy-lib. There's definitely ussl.SSLContext class: https://pycopy.readthedocs.io/en/latest/library/ussl.html#ussl.SSLContext