Show More
@@ -78,10 +78,6 b' if ssl:' | |||||
78 | CERT_NONE = ssl.CERT_NONE |
|
78 | CERT_NONE = ssl.CERT_NONE | |
79 | CERT_OPTIONAL = ssl.CERT_OPTIONAL |
|
79 | CERT_OPTIONAL = ssl.CERT_OPTIONAL | |
80 | CERT_REQUIRED = ssl.CERT_REQUIRED |
|
80 | CERT_REQUIRED = ssl.CERT_REQUIRED | |
81 | PROTOCOL_SSLv2 = ssl.PROTOCOL_SSLv2 |
|
|||
82 | PROTOCOL_SSLv3 = ssl.PROTOCOL_SSLv3 |
|
|||
83 | PROTOCOL_SSLv23 = ssl.PROTOCOL_SSLv23 |
|
|||
84 | PROTOCOL_TLSv1 = ssl.PROTOCOL_TLSv1 |
|
|||
85 | else: |
|
81 | else: | |
86 | class FakeSocket(httplib.FakeSocket): |
|
82 | class FakeSocket(httplib.FakeSocket): | |
87 | """Socket wrapper that supports SSL. |
|
83 | """Socket wrapper that supports SSL. | |
@@ -105,10 +101,7 b' else:' | |||||
105 | else: |
|
101 | else: | |
106 | raise x |
|
102 | raise x | |
107 |
|
103 | |||
108 |
PROTOCOL_SSLv2 = |
|
104 | _PROTOCOL_SSLv23 = 2 | |
109 | PROTOCOL_SSLv3 = 1 |
|
|||
110 | PROTOCOL_SSLv23 = 2 |
|
|||
111 | PROTOCOL_TLSv1 = 3 |
|
|||
112 |
|
105 | |||
113 | CERT_NONE = 0 |
|
106 | CERT_NONE = 0 | |
114 | CERT_OPTIONAL = 1 |
|
107 | CERT_OPTIONAL = 1 | |
@@ -116,7 +109,7 b' else:' | |||||
116 |
|
109 | |||
117 | def wrap_socket(sock, keyfile=None, certfile=None, |
|
110 | def wrap_socket(sock, keyfile=None, certfile=None, | |
118 | server_side=False, cert_reqs=CERT_NONE, |
|
111 | server_side=False, cert_reqs=CERT_NONE, | |
119 | ssl_version=PROTOCOL_SSLv23, ca_certs=None, |
|
112 | ssl_version=_PROTOCOL_SSLv23, ca_certs=None, | |
120 | do_handshake_on_connect=True, |
|
113 | do_handshake_on_connect=True, | |
121 | suppress_ragged_eofs=True): |
|
114 | suppress_ragged_eofs=True): | |
122 | if cert_reqs != CERT_NONE and ca_certs: |
|
115 | if cert_reqs != CERT_NONE and ca_certs: |
@@ -133,7 +133,7 b' class MockSSLSocket(object):' | |||||
133 |
|
133 | |||
134 | def mocksslwrap(sock, keyfile=None, certfile=None, |
|
134 | def mocksslwrap(sock, keyfile=None, certfile=None, | |
135 | server_side=False, cert_reqs=http.socketutil.CERT_NONE, |
|
135 | server_side=False, cert_reqs=http.socketutil.CERT_NONE, | |
136 |
ssl_version= |
|
136 | ssl_version=None, ca_certs=None, | |
137 | do_handshake_on_connect=True, |
|
137 | do_handshake_on_connect=True, | |
138 | suppress_ragged_eofs=True): |
|
138 | suppress_ragged_eofs=True): | |
139 | return MockSSLSocket(sock) |
|
139 | return MockSSLSocket(sock) |
General Comments 0
You need to be logged in to leave comments.
Login now