Skip to content

Commit

Permalink
Fix plugin name in logs
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Dec 22, 2022
1 parent 2291bf0 commit 586f606
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ func (ta *TLSAuth) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// Check if we have a client certificate.
switch {
case r.TLS == nil:
http.Error(w, "TLS encryption is required for TLS based client authentication. (traefik-tlsauth)", http.StatusBadRequest)
http.Error(w, "TLS encryption is required for TLS based client authentication. (tlsauth)", http.StatusBadRequest)
return
case len(r.TLS.PeerCertificates) == 0:
http.Error(w, "TLS client certificate is required for TLS based client authentication. (traefik-tlsauth)", http.StatusBadRequest)
http.Error(w, "TLS client certificate is required for TLS based client authentication. (tlsauth)", http.StatusBadRequest)
return
}

// Find a user with the certificate.
username, ok := ta.findUserByCert(r.TLS.PeerCertificates[0])
if !ok {
// Respond with error when no user could be found.
http.Error(w, "TLS client certificate not permitted. (traefik-tlsauth)", http.StatusForbidden)
http.Error(w, "TLS client certificate not permitted. (tlsauth)", http.StatusForbidden)
return
}

Expand Down

0 comments on commit 586f606

Please sign in to comment.