You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Benoit Sigoure (JIRA)" <ji...@apache.org> on 2017/01/11 05:04:58 UTC

[jira] [Commented] (THRIFT-4026) TSSLSocket doesn't work with Python 2.7

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

Benoit Sigoure commented on THRIFT-4026:
----------------------------------------

Also after fixing this, you'll have to fix {{test_client_cert}}

{code}
======================================================================
ERROR: test_client_cert (__main__.TSSLSocketTest)                                                                      
----------------------------------------------------------------------                                                 
Traceback (most recent call last):
  File "test/test_sslsocket.py", line 242, in test_client_cert                                                         
    certfile=SERVER_CERT, ca_certs=CLIENT_CERT)
  File "test/test_sslsocket.py", line 115, in _server_socket                                                           
    return TSSLServerSocket(port=0, **kwargs)                                                                          
  File "/bld/thrift/Artools-rpmbuild/thrift-0.10.0/lib/py/build/lib.linux-i686-2.7/thrift/transport/TSSLSocket.py", line 349, in __init__
    raise ValueError('Need ipaddress and backports.ssl_match_hostname '                                                
ValueError: Need ipaddress and backports.ssl_match_hostname module to verify client certificate                        
        
----------------------------------------------------------------------                                                 
{code}

> TSSLSocket doesn't work with Python 2.7
> ---------------------------------------
>
>                 Key: THRIFT-4026
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4026
>             Project: Thrift
>          Issue Type: Bug
>          Components: Python - Library
>    Affects Versions: 0.10.0
>         Environment: Python 2.7.5
>            Reporter: Benoit Sigoure
>            Priority: Critical
>
> As a result of a change made in THRIFT-3917, {{TSSLSocket}} now fails with a {{TypeError}} in {{open()}}:
> {code}
>   File "/bld/thrift/Artools-rpmbuild/thrift-0.10.0/lib/py/build/lib.linux-i686-2.7/thrift/transport/TSSLSocket.py", line 293, in open
>     self._validate_callback(self.peercert, self._server_hostname)
> TypeError: legacy_validate_callback() takes exactly 3 arguments (2 given)
> {code}
> Indeed, {{legacy_validate_callback()}} takes an extra {{self}} argument, which cannot possibly be compatible with the signature of [{{ssl.match_hostname()}}|https://docs.python.org/3/library/ssl.html#ssl.match_hostname] (which was added in Python 3.2).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)