-
-
Notifications
You must be signed in to change notification settings - Fork 202
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
TlsConnector adds certificate chain from PKCS12 identity in reverse order #110
Comments
What order are the certificates stored in the PKCS12 file? |
If I dump it with keytool the order is correct: It also works fine with Java TLS client or for example with openssl s_client command when exported into pem file (openssl pkcs12 -in identity.p12 -out server.pem -nodes) and the pem file has it listed in proper order as well: [private key, leaf, intermediate, root]. |
The stack is the reverse of what you might expect due to the way PKCS12_parse is implemented, so we need to load it backwards. Closes #110
#111 should fix this - could you try it out to confirm? |
I think it's only implemented for TlsAcceptor in this PR, should be also changed for TlsConnector. When I change it manually it works, yes. |
Great! I'll cut a release with the fix this morning. |
The stack is the reverse of what you might expect due to the way PKCS12_parse is implemented, so we need to load it backwards. Closes #110
Using native-tls 0.2.1 on Linux (openssl).
When building TlsConnector with pkcs12 identity which contains 3 certificates: [leaf, intermediate, root] the intermediate and root certificates are sent to the server peer in reverse order [leaf, root, intermediate] resulting in handshake errors (in particular the javax.net.ssl.SSLException: subject/issuer name chaining check failed).
The text was updated successfully, but these errors were encountered: