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
{{ message }}
Repository navigation
Add optional flags to pass client cert for step certificate inspect #65
When debugging mTLS'd environments it's handy to be able to inspect a server's cert remotely granted one is possession of a valid cert to pass client auth on the server.
Expected behaviour
Optional flags for subcommand to provide cert, e.g. step certificate inspect --roots federated.pem --cert client.crt --key client.key https://127.0.0.1:443
Actual behaviour
Fails because the server rejects client requests without/invalid certs.
@sourishkrout - I was looking at this and it seems that the client certificate is not required to inspect the peer certificate. The server certificate is sent to the client as part of the ServerHello in the TLS handshake so it's available for inspection irrespective of the client behavior. If the server requires a client certificate, it will fail the TLS handshake, but that's after the certificate exchange.
I'm curious if you've seen different behavior?
Here's the test that I did while researching this issue:
I wanted this the other day when I was troubleshooting why my client certificate was not working.
As such, is not the peer certificate that is interesting, but rather validating the client certificate with the peer certificate.
Activity
davidnarayan commentedon Dec 8, 2020
@sourishkrout - I was looking at this and it seems that the client certificate is not required to inspect the peer certificate. The server certificate is sent to the client as part of the
ServerHelloin the TLS handshake so it's available for inspection irrespective of the client behavior. If the server requires a client certificate, it will fail the TLS handshake, but that's after the certificate exchange.I'm curious if you've seen different behavior?
Here's the test that I did while researching this issue:
Go server requiring mTLS:
Start the server:
Run
stepto inspect the certificate:Note that the server logged an error message because the client didn't provide a certificate:
However, the peer certificate inspection still completed.
Are there perhaps other use cases or different behaviors that you've observed with other TLS servers?
isodude commentedon Apr 24, 2025
I wanted this the other day when I was troubleshooting why my client certificate was not working.
As such, is not the peer certificate that is interesting, but rather validating the client certificate with the peer certificate.
hslatman commentedon Apr 24, 2025
@isodude this might (soon) be of use: #1402