##// END OF EJS Templates
sslutil: drop support for clients of sslutil specifying a TLS version...
Augie Fackler -
r23849:58080815 default
parent child Browse files
Show More
@@ -18,10 +18,9 b' try:'
18 18 try:
19 19 ssl_context = ssl.SSLContext
20 20
21 def ssl_wrap_socket(sock, keyfile, certfile, ssl_version=PROTOCOL_TLSv1,
22 cert_reqs=ssl.CERT_NONE, ca_certs=None,
23 serverhostname=None):
24 sslcontext = ssl.SSLContext(ssl_version)
21 def ssl_wrap_socket(sock, keyfile, certfile, cert_reqs=ssl.CERT_NONE,
22 ca_certs=None, serverhostname=None):
23 sslcontext = ssl.SSLContext(PROTOCOL_TLSv1)
25 24 if certfile is not None:
26 25 sslcontext.load_cert_chain(certfile, keyfile)
27 26 sslcontext.verify_mode = cert_reqs
@@ -37,12 +36,11 b' try:'
37 36 raise util.Abort(_('ssl connection failed'))
38 37 return sslsocket
39 38 except AttributeError:
40 def ssl_wrap_socket(sock, keyfile, certfile, ssl_version=PROTOCOL_TLSv1,
41 cert_reqs=ssl.CERT_NONE, ca_certs=None,
42 serverhostname=None):
39 def ssl_wrap_socket(sock, keyfile, certfile, cert_reqs=ssl.CERT_NONE,
40 ca_certs=None, serverhostname=None):
43 41 sslsocket = ssl.wrap_socket(sock, keyfile, certfile,
44 42 cert_reqs=cert_reqs, ca_certs=ca_certs,
45 ssl_version=ssl_version)
43 ssl_version=PROTOCOL_TLSv1)
46 44 # check if wrap_socket failed silently because socket had been
47 45 # closed
48 46 # - see http://bugs.python.org/issue13721
@@ -56,9 +54,8 b' except ImportError:'
56 54
57 55 import socket, httplib
58 56
59 def ssl_wrap_socket(sock, keyfile, certfile, ssl_version=PROTOCOL_TLSv1,
60 cert_reqs=CERT_REQUIRED, ca_certs=None,
61 serverhostname=None):
57 def ssl_wrap_socket(sock, keyfile, certfile, cert_reqs=CERT_REQUIRED,
58 ca_certs=None, serverhostname=None):
62 59 if not util.safehasattr(socket, 'ssl'):
63 60 raise util.Abort(_('Python SSL support not found'))
64 61 if ca_certs:
@@ -126,8 +123,7 b' def _plainapplepython():'
126 123 exe.startswith('/system/library/frameworks/python.framework/'))
127 124
128 125 def sslkwargs(ui, host):
129 kws = {'ssl_version': PROTOCOL_TLSv1,
130 }
126 kws = {}
131 127 hostfingerprint = ui.config('hostfingerprints', host)
132 128 if hostfingerprint:
133 129 return kws
General Comments 0
You need to be logged in to leave comments. Login now