Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion go-server-server/go/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"log"
"net/http"
"strings"
"strconv"
)

func CommonNameMatch(r *http.Request) bool {
Expand Down Expand Up @@ -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;
}
Loading