diff --git a/go-server-server/go/auth.go b/go-server-server/go/auth.go index 21c9e1b..47bff1d 100644 --- a/go-server-server/go/auth.go +++ b/go-server-server/go/auth.go @@ -4,6 +4,7 @@ import ( "log" "net/http" "strings" + "strconv" ) func CommonNameMatch(r *http.Request) bool { @@ -42,6 +43,11 @@ func CommonNameMatch(r *http.Request) bool { } } - log.Printf("error: Authentication Fail! None of the common names in the client cert match any of the trusted common names") + commonNames := make([]string, 0) + for _, peercert := range r.TLS.PeerCertificates { + commonNames = append(commonNames, strconv.Quote(peercert.Subject.CommonName)) + } + log.Printf("error: Authentication Failed! None of the common names in the client cert chain" + + " matched any of the trusted common names. Client cert common names: %v", commonNames) return false; } \ No newline at end of file