[ 
https://issues.apache.org/jira/browse/THRIFT-4577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16504698#comment-16504698
 ] 

ASF GitHub Bot commented on THRIFT-4577:
----------------------------------------

jeking3 closed pull request #1560: THRIFT-4577 Outdated cipher string in python 
unit test
URL: https://github.com/apache/thrift/pull/1560
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/lib/py/test/test_sslsocket.py b/lib/py/test/test_sslsocket.py
index 3c4be9c2ab..f1344e57d2 100644
--- a/lib/py/test/test_sslsocket.py
+++ b/lib/py/test/test_sslsocket.py
@@ -42,7 +42,7 @@
 CLIENT_KEY = os.path.join(ROOT_DIR, 'test', 'keys', 'client_v3.key')
 CLIENT_CA = os.path.join(ROOT_DIR, 'test', 'keys', 'CA.pem')
 
-TEST_CIPHERS = 'DES-CBC3-SHA'
+TEST_CIPHERS = 'DES-CBC3-SHA:ECDHE-RSA-AES128-GCM-SHA256'
 
 
 class ServerAcceptor(threading.Thread):
@@ -95,6 +95,11 @@ def client(self):
         self._client_accepted.wait()
         return self._client
 
+    def close(self):
+        if self._client:
+            self._client.close()
+        self._server.close()
+
 
 # Python 2.6 compat
 class AssertRaises(object):
@@ -125,9 +130,7 @@ def _connectable_client(self, server, expect_failure=False, 
path=None, **client_
             client = TSSLSocket(host, port, unix_socket=path, **client_kwargs)
             yield acc, client
         finally:
-            if acc.client:
-                acc.client.close()
-            server.close()
+            acc.close()
 
     def _assert_connection_failure(self, server, path=None, **client_args):
         logging.disable(logging.CRITICAL)


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Outdated cipher string in python unit test
> ------------------------------------------
>
>                 Key: THRIFT-4577
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4577
>             Project: Thrift
>          Issue Type: Bug
>          Components: Python - Library
>    Affects Versions: 0.11.0
>         Environment: OpenSSL 1.1.0h
>            Reporter: Aki Sukegawa
>            Assignee: Aki Sukegawa
>            Priority: Minor
>
>  
> test_ciphers fails if system SSL doesn't support "DES-CBC3-SHA" which is 
> quite old.
> Adding an additional modern cipher fixes it.
> {code:java}
> ====================================================================== 
> ERROR: test_ciphers (__main__.TSSLSocketTest) 
> ---------------------------------------------------------------------- 
> Traceback (most recent call last): 
>   File 
> "/data/x/repo/thrift/lib/py/build/lib.linux-x86_64-3.6/thrift/transport/TSSLSocket.py",
>  line 281, in _do_open 
>     return self._wrap_socket(plain_sock) 
>   File 
> "/data/x/repo/thrift/lib/py/build/lib.linux-x86_64-3.6/thrift/transport/TSSLSocket.py",
>  line 179, in _wrap_socket 
>     self.ssl_context.set_ciphers(self.ciphers) 
> ssl.SSLError: ('No cipher can be selected.',) 
>  
> During handling of the above exception, another exception occurred: 
>  
> Traceback (most recent call last): 
>   File "test/test_sslsocket.py", line 268, in test_ciphers 
>     self._assert_connection_success(server, ca_certs=SERVER_CERT, 
> ciphers=TEST_CIPHERS) 
>   File "test/test_sslsocket.py", line 156, in _assert_connection_success 
>     client.open() 
>   File 
> "/data/x/repo/thrift/lib/py/build/lib.linux-x86_64-3.6/thrift/transport/TSSLSocket.py",
>  line 289, in open 
>     super(TSSLSocket, self).open() 
>   File 
> "/data/x/repo/thrift/lib/py/build/lib.linux-x86_64-3.6/thrift/transport/TSocket.py",
>  line 101, in open 
>     handle = self._do_open(family, socktype) 
>   File 
> "/data/x/repo/thrift/lib/py/build/lib.linux-x86_64-3.6/thrift/transport/TSSLSocket.py",
>  line 286, in _do_open 
>     raise TTransportException(TTransportException.NOT_OPEN, msg) 
> thrift.transport.TTransport.TTransportException: failed to initialize 
> SSL{code}
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to