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.

classification
Title: [asyncio] ssl socket gets into broken state when client exits during handshake
Type: behavior Stage: resolved
Components: asyncio Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: yselivanov Nosy List: asvetlov, carlbordum, christian.heimes, gvanrossum, ovex, yselivanov
Priority: normal Keywords: patch

Created on 2015-10-01 20:06 by ovex, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
example_files.tar.gz ovex, 2015-10-01 20:06
Pull Requests
URL Status Linked Edit
PR 22541 closed carlbordum, 2020-10-04 14:51
Messages (5)
msg252052 - (view) Author: Oleg (ovex) Date: 2015-10-01 20:06
when i run the server in one terminal and the client in another

the server output wold be:

Serving on ('127.0.0.1', 8443)
my transport None
my backlog len 2
my backlog size 4200

that output proves that it is trying to write into socket, 
while there is no transport!

see attached example server+client mini apps.
msg278165 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2016-10-05 23:49
Christian, would you be able to look into this before b2?
msg301588 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2017-09-07 14:42
This looks like a problem in asyncio. When the client closes the writer, the TLS and TCP connections are shut down. The server's writer still accept data although it is not written to the underlying ssl object:

(Pdb) writer.transport._ssl_protocol._extra['ssl_object'].pending()
0
(Pdb) writer.transport._ssl_protocol._in_shutdown
True
(Pdb) len(writer.transport._ssl_protocol._write_backlog)
2
msg377952 - (view) Author: Carl Bordum Hansen (carlbordum) * Date: 2020-10-04 15:53
I have submitted a proposed solution

Just found this similar issue https://bugs.python.org/issue35840
msg415011 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2022-03-12 20:03
asyncio ssl support was rewritten from scratch.
If you still observe the problem, please open a new issue.
History
Date User Action Args
2022-04-11 14:58:22adminsetgithub: 69479
2022-03-12 20:03:31asvetlovsetstatus: open -> closed

nosy: + asvetlov
messages: + msg415011

resolution: out of date
stage: patch review -> resolved
2020-10-05 09:09:33vstinnersetnosy: - vstinner
2020-10-05 09:04:10vstinnersettitle: ssl socket gets into broken state when client exits during handshake -> [asyncio] ssl socket gets into broken state when client exits during handshake
2020-10-04 15:53:19carlbordumsetmessages: + msg377952
2020-10-04 14:51:05carlbordumsetkeywords: + patch
nosy: + carlbordum

pull_requests: + pull_request21544
stage: patch review
2017-09-07 14:42:09christian.heimessetassignee: christian.heimes -> yselivanov
messages: + msg301588
components: - SSL
versions: - Python 3.5
2016-10-05 23:49:31yselivanovsetmessages: + msg278165
2016-09-15 08:21:32christian.heimessetversions: + Python 3.6, Python 3.7
nosy: + christian.heimes

assignee: christian.heimes
components: + SSL
type: behavior
2015-10-01 20:06:12ovexcreate