Mercurial > hg
changeset 14990:494b26ad8736 stable
httpclient: import ca33b88d143c from py-nonblocking-http (issue2932)
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Fri, 29 Jul 2011 12:46:45 -0500 |
parents | 9e9d4a762586 |
children | 4f39610996fa |
files | mercurial/httpclient/socketutil.py mercurial/httpclient/tests/util.py |
diffstat | 2 files changed, 3 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/httpclient/socketutil.py Fri Jul 29 15:36:27 2011 +0400 +++ b/mercurial/httpclient/socketutil.py Fri Jul 29 12:46:45 2011 -0500 @@ -78,10 +78,6 @@ CERT_NONE = ssl.CERT_NONE CERT_OPTIONAL = ssl.CERT_OPTIONAL CERT_REQUIRED = ssl.CERT_REQUIRED - PROTOCOL_SSLv2 = ssl.PROTOCOL_SSLv2 - PROTOCOL_SSLv3 = ssl.PROTOCOL_SSLv3 - PROTOCOL_SSLv23 = ssl.PROTOCOL_SSLv23 - PROTOCOL_TLSv1 = ssl.PROTOCOL_TLSv1 else: class FakeSocket(httplib.FakeSocket): """Socket wrapper that supports SSL. @@ -105,10 +101,7 @@ else: raise x - PROTOCOL_SSLv2 = 0 - PROTOCOL_SSLv3 = 1 - PROTOCOL_SSLv23 = 2 - PROTOCOL_TLSv1 = 3 + _PROTOCOL_SSLv23 = 2 CERT_NONE = 0 CERT_OPTIONAL = 1 @@ -116,7 +109,7 @@ def wrap_socket(sock, keyfile=None, certfile=None, server_side=False, cert_reqs=CERT_NONE, - ssl_version=PROTOCOL_SSLv23, ca_certs=None, + ssl_version=_PROTOCOL_SSLv23, ca_certs=None, do_handshake_on_connect=True, suppress_ragged_eofs=True): if cert_reqs != CERT_NONE and ca_certs:
--- a/mercurial/httpclient/tests/util.py Fri Jul 29 15:36:27 2011 +0400 +++ b/mercurial/httpclient/tests/util.py Fri Jul 29 12:46:45 2011 -0500 @@ -133,7 +133,7 @@ def mocksslwrap(sock, keyfile=None, certfile=None, server_side=False, cert_reqs=http.socketutil.CERT_NONE, - ssl_version=http.socketutil.PROTOCOL_SSLv23, ca_certs=None, + ssl_version=None, ca_certs=None, do_handshake_on_connect=True, suppress_ragged_eofs=True): return MockSSLSocket(sock)