-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Cipher preference may break SNI if certificates have different key types #6099
Comments
@izstas can you please attach the DEBUG logs for both cases? |
sniRequiredFalse.log - the log where the Test 1 and then Test 2 are executed, with I also can confirm that Jetty 10.0.2 shows the same behavior. |
The problem is as follows. The server receives a ClientHello with the The OpenJDK implementation loops over the Unfortunately, In this particular case, it will be called the first time with At this point we have no match, but we don't know if we will ever be called again. Turns out that if @gregw ideas? |
…fferent key types. Updated the logic in SslContextFactory.Server.sniSelect(...) to check if there is any certificate that matches, and if so return a null alias in the hope to be called again and pick the right alias for the SNI. Signed-off-by: Simone Bordet <[email protected]>
@izstas are you able to try branch |
…fferent key types. Updated the logic in SslContextFactory.Server.sniSelect(...) to check if there is any certificate that matches, and if so return a null alias in the hope to be called again and pick the right alias for the SNI. Signed-off-by: Simone Bordet <[email protected]>
…fferent key types. Updated the logic in SslContextFactory.Server.sniSelect(...) to check if there is any certificate that matches, and if so return a null alias in the hope to be called again and pick the right alias for the SNI. Signed-off-by: Simone Bordet <[email protected]> (cherry picked from commit 6829691)
…fferent key types. Updated the logic in SslContextFactory.Server.sniSelect(...) to check if there is any certificate that matches, and if so return a null alias in the hope to be called again and pick the right alias for the SNI. Signed-off-by: Simone Bordet <[email protected]> (cherry picked from commit 6829691)
Jetty version
10.0.1
Java version
15.0.2
OS type/version
Windows 10.0.19042.867
Description
When the keystore contains certificates with keys of different types, cipher preference seems to take precedence over SNI.
Example setup:
jetty.sslContext.sniRequired=false
(the default)Test 1 (fail)
Expected result
The certificate for rsa.example.com is presented in the TLS handshake.
Actual result
ECDHE-ECDSA-AES256-GCM-SHA384 is the selected cipher.
The certificate for ec.example.com is presented in the TLS handshake, and a 400 Invalid SNI is returned. The following can be seen in the logs:
Test 2 (success)
Actual result
The certificate for rsa.example.com is presented in the TLS handshake.
Workaround
Setting
jetty.sslContext.sniRequired=true
fixes this behavior.The text was updated successfully, but these errors were encountered: