You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SSL handshake fails when using embedded jetty and client authentication for incoming requests.
Version:
2.1.6.RELEASE
Steps to reproduce:
Exclude starter-tomcat and include starter-jetty.
Configure server.ssl.client-auth to NEED
Send a request with client certificate.
Below logs will be seen on server( debug has to be enabled)
Caused by: java.security.cert.CertificateException: No subject alternative names matching IP address <redacted> found
at sun.security.util.HostnameChecker.matchIP(HostnameChecker.java:154) ~[na:1.8.0_40]
at sun.security.util.HostnameChecker.match(HostnameChecker.java:91) ~[na:1.8.0_40]
at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:455) ~[na:1.8.0_40]
at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:436) ~[na:1.8.0_40]
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:252) ~[na:1.8.0_40]
at sun.security.ssl.X509TrustManagerImpl.checkClientTrusted(X509TrustManagerImpl.java:130) ~[na:1.8.0_40]
at sun.security.ssl.ServerHandshaker.clientCertificate(ServerHandshaker.java:1835) ~[na:1.8.0_40]
... 24 common frames omitted
I noticed this when upgrading to 9.4.15 but may have misdiagnosed the problem. It can be avoided by adding subject alternative names to the certificates which I did in 946e826.
I'm not totally sure about this, but I think typically only a server certificate would have a SAN, but not a client certificate for an end-user.
We have a similar issue to what is described in this JIRA and from reading Jetty 3454, they basically made the endpoint identification enabled by default in SSLContextFactory, but its only meant to be used on the client side, but since SSLContextFactory is used on both client and server side, it requires the server to disable it.
Given the above, I was thinking in the SslServerCustomizer it should probably use SslContextFactory.Server and call contextFactory.setEndpointIdentificationAlgorithm(null); by default.
SSL handshake fails when using embedded jetty and client authentication for incoming requests.
Version:
2.1.6.RELEASE
Steps to reproduce:
Sample project to reproduce the issue.
https://github.com/kmailkarthik/demo-springboot-issue
Root cause:
jetty/jetty.project#3454
jetty/jetty.project#3464
Fix:
Tried to change SslContextFactory to SslContextFactory.Server in below fork and it fixes the issue.
https://github.com/kmailkarthik/spring-boot/tree/2.1.x
The text was updated successfully, but these errors were encountered: