-
Notifications
You must be signed in to change notification settings - Fork 268
Add optional flags to pass client cert for step certificate inspect #65
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
Comments
@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 I'm curious if you've seen different behavior? Here's the test that I did while researching this issue: Go server requiring mTLS: package main
import (
"crypto/tls"
"fmt"
"log"
"net/http"
"net/http/httptest"
)
func main() {
ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "Hello, client")
}))
defer ts.Close()
ts.TLS = &tls.Config{
ClientAuth: tls.RequireAnyClientCert,
}
ts.StartTLS()
fmt.Println("Listening on: ", ts.URL)
select {}
} Start the server:
Run
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? |
I wanted this the other day when I was troubleshooting why my client certificate was not working. |
Subject of the issue
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.
The text was updated successfully, but these errors were encountered: