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

Do the TLS handshake in an asynchronous task to avoid blocking the service #64

Closed
wants to merge 1 commit into from

Conversation

hannesm
Copy link
Contributor

@hannesm hannesm commented May 20, 2022

Would it be possible for you to create a 0.0.8 branch, merge this commit in there, and release a 0.0.8.1? Thanks a lot.

This may happen when a partial TLS handshake is being done by one client, which
blocks any other clients from establishing a TLS connection (since all is done
within the main task).

Reproduce by running:
echo 1603034800 | perl -e 'print pack "H*", ' | nc $host 443
and attempting to establish a https connection to the same host

Adapted 8684c71 to 0.0.8

separate tcp connection from tls connection

Co-Authored-By: Lucas Pluvinage lucas@tarides.com

…rvice

This may happen when a partial TLS handshake is being done by one client, which
blocks any other clients from establishing a TLS connection (since all is done
within the main task).

Reproduce by running:
echo 1603034800 | perl -e 'print pack "H*", <STDIN>' | nc $host 443
and attempting to establish a https connection to the same host

Adapted 8684c71 to 0.0.8

separate tcp connection from tls connection

Co-Authored-By: Lucas Pluvinage <lucas@tarides.com>
dinosaure added a commit to dinosaure/opam-repository that referenced this pull request May 21, 2022
CHANGES:

- Do the TLS handshake in an asynchronous task (@TheLortex, @hannesm, dinosaure/paf-le-chien#64)
@dinosaure
Copy link
Owner

Thanks, I did the release and I will try to integrate your reproducible test into the distribution 👍.

@dinosaure dinosaure closed this May 22, 2022
@hannesm
Copy link
Contributor Author

hannesm commented May 22, 2022

Thank you very much. To explain the test: it opens a TCP connection and sends a TLS header (handhsake frame = 0x16; version = 0x03 0x03; length = 0x4800 = 18432), so the TLS reader waits for another 18432 before continuing processing the data.

@hannesm hannesm deleted the 0.0.8 branch May 22, 2022 14:54
@hannesm hannesm restored the 0.0.8 branch May 22, 2022 14:56
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.

None yet

2 participants