-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Patch v1] Added TLS 1.3 support for PHP #3650
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
Conversation
I added some comments which are mainly about missing compatibility with older OpenSSL versions. That's really required as we need to support multiple OpenSSL versions (currently 1.0.1+). We will also need to address the setting of the cipher suites which works differently for 1.3 - see https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_ciphersuites.html . I think it doesn't need to be addressed in this patch but we shouldn't enable TLS 1.3 by default for now. |
Another reason why we shouldn't enable it by default at this point is that I'm not sure how well it will work with our non-blocking handling that has got some issues and it's a bit mess. So considering that TLSv1.3 sends more non-application data records after the handshake is finished, it might show some bugs. |
@bukka : backwards compatibility with tls <=1.2 works correctly with the fixes. |
@codarrenvelvindron Just tested with OpenSSL 1.1.1 and the session_meta_capture_tlsv13.phpt is failing for me:
Is it actually working for you? |
It's working with versions less than 1.1.1 but for >= 1.1.1 the actual test is failing for me as well. According to the error messages, it seems unable to negotiate a proper cipher for tls 1.3. Seems we'll have to implement SSL_CTX_set_ciphersuites() in this patch. @bukka : What do you think? |
$serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN; | ||
$serverCtx = stream_context_create(['ssl' => [ | ||
'local_cert' => __DIR__ . '/bug54992.pem' | ||
]]); |
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.
you need to replace it with
$serverCtx = stream_context_create(['ssl' => [
'local_cert' => __DIR__ . '/bug54992.pem',
'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_3_SERVER,
]]);
@codarrenvelvindron See my comment how to fix it: https://github.com/php/php-src/pull/3650/files#r238112239 . Once you fix it, please squash it and I will test it a bit more and then possibly merge it. I don't think we need |
- add support for following secure options: tls-versions, tls-ciphersuites, ssl-ciphers - improve parsing Uri (e.g. previously in some cases ssl-mode has to always be in front of other secure options) - improve error messages - support trying open secure connections in loop for various TLS versions - still waiting for patches related to TLSv1.3 support in PHP: php/php-src#3650 php/php-src#3700 php/php-src#3909
Work done during IETF 103 hackathon
~ codarren at cyberstorm.mu ~