Commit 924e6682 authored by Denis Bilenko's avatar Denis Bilenko

add wrap_socket function to sslold module for better compatibility with ssl module

parent be8c879a
......@@ -168,3 +168,15 @@ def ssl(sock, keyfile=None, certfile=None):
# yes, do the handshake
ssl_sock.do_handshake()
return ssl_sock
def wrap_socket(sock, keyfile=None, certfile=None,
server_side=None, cert_reqs=None,
ssl_version=None, ca_certs=None,
do_handshake_on_connect=None,
suppress_ragged_eofs=None):
for arg in ['cert_reqs', 'ssl_version', 'ca_certs', 'do_handshake_on_connect', 'suppress_ragged_eofs']:
if locals()[arg] is not None:
raise TypeError('To use argument %r install ssl package: http://pypi.python.org/pypi/ssl' % arg)
return ssl(sock, keyfile=keyfile, certfile=certfile)
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