Commit 8690f1f1 authored by Jason Madden's avatar Jason Madden

Use the correct ssl module to implement the deprecated socket.ssl function.

parent 8f2e9b7c
......@@ -397,10 +397,15 @@ else:
__implements__.remove('fromfd')
if hasattr(__socket__, 'ssl'):
from gevent.hub import PYGTE279
def ssl(sock, keyfile=None, certfile=None):
# deprecated in 2.7.9 but still present
from . import _ssl2
return _ssl2.sslwrap_simple(sock, keyfile, certfile)
if PYGTE279:
from . import _sslgte279
return _sslgte279.wrap_socket(sock, keyfile, certfile)
else:
from . import _ssl2
return _ssl2.sslwrap_simple(sock, keyfile, certfile)
__implements__.append('ssl')
__all__ = __implements__ + __extensions__ + __imports__
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment