Open
Conversation
Author
|
It seems like this CI failure is not related to the changes in this pull request, but rather to the dependency installation step. Could you please take a look on the CI side and check what’s causing the failure? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi!
I used trantor as the main networking library in my project.
While working on it, I had a strong need to support automatic SSL/TLS connections. I know that trantor already supports delayed SSL, where the client first sends a signal message (for example,
ssl-hello) indicating that it is going to start an encrypted connection, and only then the TLS handshake begins. However, in the project I’m working on, the client can start an SSL/TLS encrypted connection immediately, without any signal message or warning, and it was critically important for us to support this behavior.To achieve this, I implemented a small helper function called
forwardToTLSBuffer. Its purpose is to move the data currently stored in the buffer of the existing plaintext connection into the buffer of the new TLS connection.If the server receives data on a plaintext connection and that data appears to start with an SSL/TLS handshake, the server detects it and upgrades the connection to TLS, passing the already-received handshake bytes using
forwardToTLSBuffer.To demonstrate how it works, I added two tests:
AutomaticSSLClientTest.ccandAutomaticSSLServerTest.cc(following the structure ofDelayedSSLClientTest.ccandDelayedSSLServerTest.cc).With this change, trantor can be used to build a “smart server” that dynamically adapts to the client’s connection type (plain TCP or TLS) on the fly.