-
Notifications
You must be signed in to change notification settings - Fork 51
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
AttributeError: module 'ssl' has no attribute 'wrap_socket' #108
Comments
Thanks! I didn't know about this one. This is indeed because ssl library changes in latest Python. I was looking at the connect(..) here -- unfortunately, it looks like it hasn't been written in a manner that allows for SSL context to overridden by child classes, without copying the entire function. That being said, we can perhaps try having
.. can you please confirm if this works for you? If so, I'll try incorporating this in this library.. |
<div></div><div>Thanks! I didn't know about this one. This is indeed because ssl library changes in latest Python.
<br/>
<br/>I was looking [at the connect(..) here](https://github.com/Lawouach/WebSocket-for-Python/blob/961c07ce16ce4eedc34ca1fdacd29442870feccc/ws4py/client/__init__.py#L214) -- unfortunately, it looks like it hasn't been written in a manner that allows for SSL context to overridden by child classes, without copying the entire function.
<br/>
<br/>That being said, we can perhaps try having `ssl.wrap_socket` point to something else ( **HACKY + UNTESTED**):
<br/>
<br/>```
<br/># Before any library imports that depends on ssl..
<br/>ssl.wrap_socket = ssl.SSLContext().wrap_socket
<br/>```
<br/>
<br/>.. can you please confirm if this works for you? If so, I'll try incorporating this in this library..
<br/>
<br/>--
<br/>Reply to this email directly or view it on GitHub:
<br/>#108 (comment)
<br/>You are receiving this because you authored the thread.
<br/>
<br/>Message ID: ***@***.***></div>
|
Yes, his solution works, add the protocol to skip the deprecation warning. ssl.wrap_socket = ssl.SSLContext(protocol=ssl.PROTOCOL_TLSv1_2).wrap_socket |
Whas this already implemented? I just installed 8.10 but I am getting this error. Exception has occurred: AttributeError |
Hi,
Using secure connection, I am getting an error:
AttributeError: module 'ssl' has no attribute 'wrap_socket'
I suspect it is due to a change in Python -- see eventlet/eventlet#795. It would be great if you could take a look at this!
The text was updated successfully, but these errors were encountered: