classification
Title: ssl module sets "debug" flag on SSL struct
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.1, Python 3.2, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, exarkun, giampaolo.rodola, janssen, pitrou, srid
Priority: high Keywords:

Created on 2010-06-24 23:03 by pitrou, last changed 2010-06-30 01:21 by srid. This issue is now closed.

Messages (4)
msg108561 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-06-24 23:03
The ssl module sets a "debug" flag on the OpenSSL SSL struct at the end of PySSL_SSLdo_handshake():

    self->ssl->debug = 1;

The OpenSSL header files have this to say about this flag:

        /* set this flag to 1 and a sleep(1) is put into all SSL_read()
         * and SSL_write() calls, good for nbio debuging :-) */
        int debug;      

Some uses of it in the OpenSSL source are actually guarded by a macro (#ifdef PKT_DEBUG), but some are not. Bill, do you remember why you put that call? I would find it strongly preferrable to remove that assignment (doing so doesn't seem to break anything in the test suite).
msg108563 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-06-24 23:23
Actually, looking at the history of the SVN repo, this dates back to 1999 when the first SSL support was incorporated by Guido based on third-party patches, and no trace of a review discussion can be found. The only thing we can do is assume it's useless (and perhaps detrimental to performance) and remove it now.

Benjamin, do you think it's safe for 2.7 or should wait for 2.7.1?
msg108570 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2010-06-24 23:55
Let it die.
msg108573 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-06-25 00:13
Thanks! Committed in r82210 (trunk), r82211 (py3k), r82212 (2.6), r82213 (3.1).
History
Date User Action Args
2010-06-30 01:21:03sridsetnosy: + srid
2010-06-25 00:13:34pitrousetstatus: open -> closed
resolution: fixed
messages: + msg108573

stage: resolved
2010-06-24 23:55:25benjamin.petersonsetmessages: + msg108570
2010-06-24 23:23:12pitrousetnosy: + benjamin.peterson
messages: + msg108563
2010-06-24 23:03:13pitroucreate