##// END OF EJS Templates
sslutil: only support TLS (BC)...
Augie Fackler -
r23069:22db4055 stable
parent child Browse files
Show More
@@ -14,7 +14,6 b' try:'
14 # avoid using deprecated/broken FakeSocket in python 2.6
14 # avoid using deprecated/broken FakeSocket in python 2.6
15 import ssl
15 import ssl
16 CERT_REQUIRED = ssl.CERT_REQUIRED
16 CERT_REQUIRED = ssl.CERT_REQUIRED
17 PROTOCOL_SSLv23 = ssl.PROTOCOL_SSLv23
18 PROTOCOL_TLSv1 = ssl.PROTOCOL_TLSv1
17 PROTOCOL_TLSv1 = ssl.PROTOCOL_TLSv1
19 def ssl_wrap_socket(sock, keyfile, certfile, ssl_version=PROTOCOL_TLSv1,
18 def ssl_wrap_socket(sock, keyfile, certfile, ssl_version=PROTOCOL_TLSv1,
20 cert_reqs=ssl.CERT_NONE, ca_certs=None):
19 cert_reqs=ssl.CERT_NONE, ca_certs=None):
@@ -29,7 +28,6 b' try:'
29 except ImportError:
28 except ImportError:
30 CERT_REQUIRED = 2
29 CERT_REQUIRED = 2
31
30
32 PROTOCOL_SSLv23 = 2
33 PROTOCOL_TLSv1 = 3
31 PROTOCOL_TLSv1 = 3
34
32
35 import socket, httplib
33 import socket, httplib
@@ -103,12 +101,7 b' def _plainapplepython():'
103 exe.startswith('/system/library/frameworks/python.framework/'))
101 exe.startswith('/system/library/frameworks/python.framework/'))
104
102
105 def sslkwargs(ui, host):
103 def sslkwargs(ui, host):
106 forcetls = ui.configbool('ui', 'tls', default=True)
104 kws = {'ssl_version': PROTOCOL_TLSv1,
107 if forcetls:
108 ssl_version = PROTOCOL_TLSv1
109 else:
110 ssl_version = PROTOCOL_SSLv23
111 kws = {'ssl_version': ssl_version,
112 }
105 }
113 hostfingerprint = ui.config('hostfingerprints', host)
106 hostfingerprint = ui.config('hostfingerprints', host)
114 if hostfingerprint:
107 if hostfingerprint:
General Comments 0
You need to be logged in to leave comments. Login now