Return-Path: Delivered-To: apmail-thrift-dev-archive@www.apache.org Received: (qmail 49251 invoked from network); 19 Mar 2011 23:42:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 Mar 2011 23:42:51 -0000 Received: (qmail 79065 invoked by uid 500); 19 Mar 2011 23:42:51 -0000 Delivered-To: apmail-thrift-dev-archive@thrift.apache.org Received: (qmail 79030 invoked by uid 500); 19 Mar 2011 23:42:51 -0000 Mailing-List: contact dev-help@thrift.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@thrift.apache.org Delivered-To: mailing list dev@thrift.apache.org Received: (qmail 79022 invoked by uid 99); 19 Mar 2011 23:42:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Mar 2011 23:42:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Mar 2011 23:42:50 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 87D08400A59 for ; Sat, 19 Mar 2011 23:42:29 +0000 (UTC) Date: Sat, 19 Mar 2011 23:42:29 +0000 (UTC) From: "Will Pierce (JIRA)" To: dev@thrift.apache.org Message-ID: <1785298743.13951.1300578149552.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1621703731.13949.1300577790085.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Updated: (THRIFT-1100) python TSSLSocket improvements, including certificate validation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/THRIFT-1100?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Will Pierce updated THRIFT-1100: -------------------------------- Attachment: THRIFT-1100.python_ssl_enhance_and_cert_validate.patch patch attached: adds lots of code to lib/py/src/transport/TSSLSocket.py and touches 2 lines in lib/py/src/transport/TSocket.py > python TSSLSocket improvements, including certificate validation > ---------------------------------------------------------------- > > Key: THRIFT-1100 > URL: https://issues.apache.org/jira/browse/THRIFT-1100 > Project: Thrift > Issue Type: Improvement > Components: Python - Library > Reporter: Will Pierce > Assignee: Will Pierce > Attachments: THRIFT-1100.python_ssl_enhance_and_cert_validate.patch > > > The python TSSLSocket.py module has TSSLSocket and TSSLServerSocket for outbound and inbound SSL connection wrapping. > This ticket is for a patch that makes several improvements: > * adds Apache license at top of file > * for outbound sockets, SSL certificate validation is now performed by default > ** but may be disabled with validate=False in the constructor > ** instructs python's ssl library to perform CERT_REQUIRED validation of the certificate > ** also checks to make sure the certificate's {{commonName}} matches the hostname we tried to connect to > ** raises TTransportExceptions when the certificate fails validation - tested using google's www.gmail.com (doesnt match) versus mail.google.com (matched cert commonName) > ** puts a copy of the peer certificate in self.peercert, regardless of validation status > ** sets a public boolean self.is_valid member variable to indicate whether the certificate was validated or not > * adds a configurable server certificate file, as a constructor argument {{certfile}} > ** allows runtime changing of server cert with setCertfile() on the server, that changes the certfile used in subsequent ssl_wrap() calls > ** exposes a class-level variable SSL_PROTOCOL to let the user select ssl.PROTOCOL_TLSv1 or other versions of SSL, instead of hard-coding TLSv1. Defaults to TLSv1 though. > * removes unnecessary sys.path modification > * adds lots of docstrings > In a somewhat unrelated change, this patch changes two lines in TSocket.py where self.handle is compared to None using {{!=}} instead of: {{is not}}. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira