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
ReferenceCountedOpenSslEngine on jdk without TLSv1.3 should set SSL_OP_NO_TLSv1_3 #12968
Comments
The |
There is code in place that explicitly checks for whether or not the JDK supports TLSv1.3 , even when using OpenSSL. From #11604 . As seen in the reproducer code above, that check seems to correctly disable |
Motivation: If TLSv1.3 is not supported we should set SSL_OP_NO_TLSv1_3 explicit to ensure we never "advertise" it. Modifications: Set SSL_OP_NO_TLSv1_3 if TLSv1.3 is not supported Result: Fixes #12968
@oskarwiksten PTAL #13066 ... I am a bit surprised that it was not enough what we did here tho: |
) Motivation: If TLSv1.3 is not supported we should set SSL_OP_NO_TLSv1_3 explicit to ensure we never "advertise" it. Modifications: Set SSL_OP_NO_TLSv1_3 if TLSv1.3 is not supported Result: Fixes #12968
) Motivation: If TLSv1.3 is not supported we should set SSL_OP_NO_TLSv1_3 explicit to ensure we never "advertise" it. Modifications: Set SSL_OP_NO_TLSv1_3 if TLSv1.3 is not supported Result: Fixes #12968
Thank you @normanmaurer . This resolves the issue we were seeing. Have also verified the fix on the application we had the original problem with, running on JRE |
Expected behavior
Using an older jdk such as 1.8.0_172 without support for TLSv1.3 should set the
SSL_OP_NO_TLSv1_3
bit in openssl options.Actual behavior
The
SSL_OP_NO_TLSv1_3
-bit ("do not use TLSv1.3"-bit) is only set if the list of protocols is explicitly specified, even if the jdk lacks support for TLSv1.3.The consequence of this bit not being set is that tls handshakes for a server on such a jdk will use TLSv1.3, eventhough it is not fully supported.
Steps to reproduce
io.netty.handler.ssl.SslUtils::isTLSv13SupportedByJDK
to always returnfalse
ReferenceCountedOpenSslEngine
SSL_OP_NO_TLSv1_3
-bit in openssl optionsMinimal yet complete reproducer code (or URL to code)
Output from above code:
io.netty.handler.ssl.SslUtils::isTLSv13SupportedByJDK
to always returnfalse
'Do not use TLSv1.3' before
should also printtrue
.Netty version
4.1.84.Final
2.0.54.Final
JVM version (e.g.
java -version
)OS version (e.g.
uname -a
)Workarounds
If either of the following things is done, the issue does not happen:
-Djdk.tls.server.protocols=TLSv1.2
SslContextBuilder::protocols
orReferenceCountedOpenSslEngine::setEnabledProtocols
sslEngine.setEnabledProtocols(sslEngine.getEnabledProtocols())
as indicated in above reproducer-codeNow, using such an old jdk might be a niche use-case and possibly something that is not supported. But the fact that calling
e.setEnabledProtocols(e.getEnabledProtocols())
has an effect on the options-bits seems unexpected.The text was updated successfully, but these errors were encountered: