This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: ssl.SSLSocket().close() does not close the connection
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.6
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: PoltoS, TTT, amaury.forgeotdarc, dandrzejewski, eric.smith, giampaolo.rodola, orsenthil, pitrou, r.david.murray
Priority: normal Keywords:

Created on 2010-10-16 21:14 by r.david.murray, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg118896 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-10-16 21:14
Quoting PoltoS from issue 8293:

If I do sock.close() (sock is instance of ssl.SSLSocket), the connection is not closed: I see it as Established in netstat and nothing is sent over network: tcpdump show nothing going thru the network.
msg118898 - (view) Author: PoltoS (PoltoS) Date: 2010-10-16 21:24
After some investigations it seems that a dup() is called in ssl wrap_socket(), so on sock.close() the socket is not really closed, since there is still one more reference (file descriptor) in the kernel's tcp/ip stack. Can someone confirm this?

Have not done this, but it is possible to check my supposition using linux lsof command before and after .close().
msg118899 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-10-16 21:30
I cannot reproduce with 2.7, 3.1 or 3.2. It seems the issue is obsolete, many changes having been made to the ssl module since 2.6.
Date User Action Args
2022-04-11 14:57:07adminsetgithub: 54336
2010-10-18 11:40:37pitrousetstatus: pending -> closed
2010-10-16 21:30:45pitrousetstatus: open -> pending
resolution: out of date
messages: + msg118899
2010-10-16 21:24:50PoltoSsetmessages: + msg118898
2010-10-16 21:14:32r.david.murraycreate