You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Yuri Khan (Created) (JIRA)" <ji...@apache.org> on 2012/03/29 14:16:26 UTC

[jira] [Created] (THRIFT-1549) Python TSSLSocket: Shutdown cleanly

Python TSSLSocket: Shutdown cleanly
-----------------------------------

                 Key: THRIFT-1549
                 URL: https://issues.apache.org/jira/browse/THRIFT-1549
             Project: Thrift
          Issue Type: Improvement
          Components: Python - Library
    Affects Versions: 0.8
            Reporter: Yuri Khan
            Priority: Minor


When attempting to use Thrift over SSL, from a Python client to a C++ server, I noticed in the server logs:
{code:none}
Thrift: Thu Mar 29 18:45:02 2012 SSL_shutdown: error code: 0
{code}
This seems to be caused by unclean shutdown by the Python client library where TSocket just closes its socket, and is fixed by the following patch (against Thrift 0.8):
{code:none}
diff --git a/TSSLSocket.py~ b/TSSLSocket.py
index 15095d3..3e3fd2d 100644
--- a/TSSLSocket.py~
+++ b/TSSLSocket.py
@@ -88,6 +88,10 @@ class TSSLSocket(TSocket.TSocket):
     if self.validate:
       self._validate_cert()
 
+  def close(self):
+    self.handle = self.handle.unwrap()
+    TSocket.TSocket.close(self)
+
   def _validate_cert(self):
     """internal method to validate the peer's SSL certificate, and to check the
     commonName of the certificate to ensure it matches the hostname we
{code}
If needed, ping me, I will do a rebase to HEAD.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1549) Python TSSLSocket: Shutdown cleanly

Posted by "Yuri Khan (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13245099#comment-13245099 ] 

Yuri Khan commented on THRIFT-1549:
-----------------------------------

This breaks the Python—Python scenario: now when doing the {{unwrap}}, the client raises an exception saying {{error: \[Errno 0] Error}}. Would be nice to shutdown cleanly at both sides but I don’t know how to do it at the moment.
                
> Python TSSLSocket: Shutdown cleanly
> -----------------------------------
>
>                 Key: THRIFT-1549
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1549
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Python - Library
>    Affects Versions: 0.8
>            Reporter: Yuri Khan
>            Priority: Minor
>
> When attempting to use Thrift over SSL, from a Python client to a C++ server, I noticed in the server logs:
> {code:none}
> Thrift: Thu Mar 29 18:45:02 2012 SSL_shutdown: error code: 0
> {code}
> This seems to be caused by unclean shutdown by the Python client library where TSocket just closes its socket, and is fixed by the following patch (against Thrift 0.8):
> {code:none}
> diff --git a/TSSLSocket.py~ b/TSSLSocket.py
> index 15095d3..3e3fd2d 100644
> --- a/TSSLSocket.py~
> +++ b/TSSLSocket.py
> @@ -88,6 +88,10 @@ class TSSLSocket(TSocket.TSocket):
>      if self.validate:
>        self._validate_cert()
>  
> +  def close(self):
> +    self.handle = self.handle.unwrap()
> +    TSocket.TSocket.close(self)
> +
>    def _validate_cert(self):
>      """internal method to validate the peer's SSL certificate, and to check the
>      commonName of the certificate to ensure it matches the hostname we
> {code}
> If needed, ping me, I will do a rebase to HEAD.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira