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

Add TLS1.3 stream option #4

Closed

Conversation

ChristophWurst
Copy link
Contributor

Discovered in nextcloud/mail#3368 (comment).

@mrubinsk hope this is ok. Do we need a check around this? I saw that STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT doesn't have one either so I just added the constant. Let me know what you prefer.

@mrubinsk
Copy link
Member

@ChristophWurst TLS 1.3 (and that constant) are only supported starting with PHP 7.4 from the looks of it so we can't use it bare like that.

According to the php source (https://github.com/php/php-src/blob/PHP-7.4.0/main/streams/php_stream_transport.h#L176), it looks like the existing STREAM_CRYPTO_METHOD_TLS_CLIENT actually already includes all of the TLS versions in PHP 7.4 as well. So we can probably just use that constant and get of the OR's in the case of PHP 7.4.

@ChristophWurst
Copy link
Contributor Author

According to the php source (https://github.com/php/php-src/blob/PHP-7.4.0/main/streams/php_stream_transport.h#L176), it looks like the existing STREAM_CRYPTO_METHOD_TLS_CLIENT actually already includes all of the TLS versions in PHP 7.4 as well. So we can probably just use that constant and get of the OR's in the case of PHP 7.4.

7.2 in fact: https://github.com/php/php-src/blob/PHP-7.2.0/main/streams/php_stream_transport.h#L176. I'll change it to that.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@ChristophWurst
Copy link
Contributor Author

@mrubinsk please let me know if the changes are OK or if you with to have it done differently ✌️

@mrubinsk
Copy link
Member

@ChristophWurst Yup, looks good. I'll merge this as soon as I have some time.

@yunosh
Copy link
Member

yunosh commented Nov 19, 2020

This wouldn't work with PHP < 5.6 which we unfortunately still support. How about using:
STREAM_CRYPTO_METHOD_TLS_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT
if STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT exists and STREAM_CRYPTO_METHOD_TLS_CLIENT if not. Wouldn't this cover all cases?

@jstark1
Copy link

jstark1 commented Dec 18, 2021

I still hope the PR will be merged. Is there any progress here?

mrubinsk added a commit that referenced this pull request Dec 18, 2021
@mrubinsk
Copy link
Member

Apologies, this fell through the cracks. I had thought I committed this already.

@mrubinsk mrubinsk closed this Dec 18, 2021
mrubinsk added a commit that referenced this pull request Dec 18, 2021
@ChristophWurst ChristophWurst deleted the enhancement/tls-1-3-stream branch December 18, 2021 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants