Hi,
I'm running gevent 1.0.1 and python 2.7.9.
When I call:
conn = ssl_context.wrap_socket(socket.socket(socket.AF_INET), server_hostname=HOST)
I get an error in ssl.py:
Traceback (most recent call last):
File "./client.py", line 34, in <module>
use_ssl()
File "./client.py", line 25, in use_ssl
server_hostname=HOST)
File "/home/ido/pybase/2.7.9/usr/local/lib/python2.7/ssl.py", line 350, in wrap_socket
_context=self)
TypeError: __init__() got an unexpected keyword argument '_context'
and sometimes this one:
Traceback (most recent call last):
File "./client.py", line 34, in <module>
use_ssl()
File "./client.py", line 25, in use_ssl
server_hostname=HOST)
File "/home/ido/pybase/2.7.9/usr/local/lib/python2.7/ssl.py", line 350, in wrap_socket
_context=self)
TypeError: __init__() got an unexpected keyword argument 'server_hostname'
Without gevent, my code works, but then it's not in non-blocking mode. :)
I tried looking online for an answer, and it looks like a few other people ran into this problem as well, but w/o a working solution.
My guess is that gevent 1.0.1 is designed to work with python <= 2.7.8, and when the ssl module in python 2.7.9 was migrated from python 3, gevent stopped working.
I figure one solution is to move over to python 3... Unfortunately, a large code-base and dependencies may make this a no-go for me right now...
Has anyone else ran into this? Any patches out there (or coming)? Am I doing something completely wrong here? :)
Thanks,
Ido