-
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
SNI matching does not work in certain cases when there is only one CN certificate in the keystore #2886
Comments
Thanks for this report and the diagnosis of #2010 ! looking... |
Signed-off-by: Greg Wilkins <[email protected]>
@Dremon I don't think we have enough information. For commit 8660055 to make a difference for your case, you would need to have exactly 1 non-wildcard host and zero wildcard hosts, so that before commit 8660055 the expression would evaluate to @gregw while #2888 may be an improvement for that expression, but I'm not sure it changes anything for the OP of this issue. |
I think we do have enough info. The current code will enable SNI matching IFF:
or to paraphrase: SNI will be used to select a certificate IFF there are some wild card certificates OR more than 1 certificate with a host name. My proposed change is:
which can be paraphrased as: SNI will be used to select a certificate IFF there are some wild card certificates OR more than 1 certificate with a host name OR (there are more than 1 certificates AND one of them has a host name ). I guess I just have to create a unit test to confirm... stand by.... |
@gregw how can a certificate with CN and subjectAltNames and another with no CN (but presumably subjectAltNames) yield just one entry in |
To clarify: keystore contains 1 SNI certificate (CN + subjectAltNames) and 1 non-SNI certificate (CN=localhost, no subjectAltNames). This non-SNI certificate is always selected (incorrectly) even when connecting to the host name which matches first SNI certificate, unless a second SNI certificate is added (then it works). |
* Issue #2886 Handle SNI with non SNI certificates Signed-off-by: Greg Wilkins <[email protected]> * Issue #2886 Single SNI with default certificate
Jetty version 9.4.12.
Conditions:
Expected behaviour:
SNI matching works and "cert1" is selected correctly when connecting to it's host name.
Observed behaviour:
"default" certificate is always selected unless a second CN certificate is added to the keystore.
I think this is related to commit 8660055.
The text was updated successfully, but these errors were encountered: