-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
Add Opportunistic TLS implementation #302
base: 1.x
Are you sure you want to change the base?
Add Opportunistic TLS implementation #302
Conversation
c45aa34
to
6bf2080
Compare
6bf2080
to
454673d
Compare
da6bc3c
to
1c1cb5a
Compare
0275788
to
5216b9e
Compare
Thanks to a suggestion from @clue I managed to drop the dependency on reactphp/async#65 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some remarks and suggestions for the documentation, same suggestions are also important for the doc-blocks inside the added classes.
5216b9e
to
f86e4f8
Compare
@SimonFrings Let me know if you have any more pointers? Will apply them to the docblocks later today |
This commit introduces the functionality required to build opportunistic TLS clients and servers with ReactPHP. It does so by introducing a prefix to `tls://`, namely `opportunistic`, to create `opportunistic+tls://example.com:5432` for example as the full URL. This will create an `OpportunisticTlsConnectionInterface` (instead of a `ConnectionInterface`) that extends the `ConnectionInterface` and exposes the `enableEncryption` method to enable TLS encryption at the desired moment. Inside this PR is an example of a server and client negotiating when to enable TLS and enable it when ready. Opportunistic Security described in RFC7435: https://www.rfc-editor.org/rfc/rfc7435 External PR using the proposed changes in this commit: voryx/PgAsync#52
f86e4f8
to
fb5c2e7
Compare
@SimonFrings Updated the doc blocks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating, texts and the overall code structure are looking fine 👍
I am not very experienced when it comes to opportunistic TLS, so I can't really review if this is exactly the way to introduce this to the project, but the rest looks good to me.
👍
The only reason I found out |
As discussed, I've extracted this into a package: https://github.com/WyriHaximus/reactphp-opportunistic-tls |
Hello, is there a roadmap on when this can be merged? |
This PR introduces the functionality required to build opportunistic TLS clients and servers with ReactPHP. It does so by introducing a prefix to
tls://
, namelyopportunistic
, to createopportunistic+tls://example.com:5432
for example as the full URL. This will create anOpportunisticTlsConnectionInterface
(instead of aConnectionInterface
) that extends theConnectionInterface
and exposes theenableEncryption
method to enable TLS encryption at the desired moment. Inside this PR is an example of a server and client negotiating when to enable TLS and enable it when ready.Opportunistic Security described in RFC7435: https://www.rfc-editor.org/rfc/rfc7435
External PR using the proposed changes in this PR: voryx/PgAsync#52