Skip to content

Commit

Permalink
[auth] log and return 401 when checking mTLS for http writes with una…
Browse files Browse the repository at this point in the history
…uthenticated reads enabled

Access was previously being denied correctly, but we were returning
success (200) to the client and not logging an event on the server.
  • Loading branch information
mostynb committed Sep 9, 2021
1 parent a07cdc4 commit 90b107c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ func (h *httpCache) CacheHandler(w http.ResponseWriter, r *http.Request) {

case http.MethodPut:
if h.checkClientCertForWrites && !h.hasValidClientCert(w, r) {
http.Error(w, "Authentication required for write access", http.StatusUnauthorized)
h.logResponse(http.StatusUnauthorized, r)
return
}

Expand Down

0 comments on commit 90b107c

Please sign in to comment.