Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hang in SSL do_handshake and rework server shutdown routine #110

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

uzlonewolf
Copy link

I was having a problem with the server hanging and not accepting new connections. I tracked it down to connections which have been opened but then do not complete a SSL/TLS handshake. It can be reproduced by simply opening a TCP connection and then not sending anything; example python:

~$ python3

Python 3.11.2 (main, May  2 2024, 11:59:08) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

>>> import socket
>>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> s.connect(('MY IP', PORT))
>>> 

The server is now hung and no other connection can be opened.

Closes #13

I also reworked the server shutdown code so it actually sends the CLOSE command it queues up.

Closes #85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

server close() race condition Occasionally hangs in ssl do_handshake()
1 participant