-
Notifications
You must be signed in to change notification settings - Fork 26
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
Can wolfssl context be used with requests http adaptor? #10
Comments
applying the PR 8560c65 we get a new error Traceback (most recent call last):
File "./wolf.py", line 54, in <module>
print(session.get('https://somewebsite', verify=False).status_code)
File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 603, in urlopen
chunked=chunked)
File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 373, in _make_request
conn.sock.settimeout(read_timeout)
AttributeError: 'SSLSocket' object has no attribute 'settimeout' |
Monkey patching the above, just creates another issue.. httplib_response = conn.getresponse()
File "/usr/lib/python3.7/http/client.py", line 1317, in getresponse
response = self.response_class(self.sock, method=self._method)
File "/usr/lib/python3.7/http/client.py", line 234, in __init__
self.fp = sock.makefile("rb")
AttributeError: 'SSLSocket' object has no attribute 'makefile' So I guess this is not capable of being used in requests ... too many incompatibilities |
Hi @VeNoMouS, Thank you so much for reaching out to wolfSSL with your questions. For best response times feel free to email us anytime at [email protected]. Can you tell us a bit about the project you are interested in using wolfSSL in and end goals of that project? I can confirm we have not tested using wolfSSL with https://pypi.org/project/requests/ yet. Would you like us to add it to our desired features list? Desired features are features we work on for free between funded efforts. Desired features have no associated timeline but they can be accelerated at anytime if a need arrises, just let us know you'd like to accelerate a given feature and we can put you in touch with the resources to help get that done! Warmest Regards, K |
I am trying also to use wolfssl in standard HTTPServer, and received similar error. P.S. Apparently, we cannot call self._sock.makefile(), instead a copy of socket.makefile() shall be added and adapted as override method in class SSLSocket |
The following results in..
The text was updated successfully, but these errors were encountered: