THRIFT-4026 TSSLSocket doesn't work with Python < 2.7.9
This closes #1166
diff --git a/lib/py/test/test_sslsocket.py b/lib/py/test/test_sslsocket.py
index 3e4b266..8951618 100644
--- a/lib/py/test/test_sslsocket.py
+++ b/lib/py/test/test_sslsocket.py
@@ -237,6 +237,9 @@
self._assert_connection_success(server, cert_reqs=ssl.CERT_REQUIRED, ca_certs=SERVER_CERT)
def test_client_cert(self):
+ if not _match_has_ipaddress:
+ print('skipping test_client_cert')
+ return
server = self._server_socket(
cert_reqs=ssl.CERT_REQUIRED, keyfile=SERVER_KEY,
certfile=SERVER_CERT, ca_certs=CLIENT_CERT)
@@ -333,7 +336,7 @@
if __name__ == '__main__':
logging.basicConfig(level=logging.WARN)
- from thrift.transport.TSSLSocket import TSSLSocket, TSSLServerSocket
+ from thrift.transport.TSSLSocket import TSSLSocket, TSSLServerSocket, _match_has_ipaddress
from thrift.transport.TTransport import TTransportException
unittest.main()