Skip to content

Commit 7396430

Browse files
authored
handle case where r.TLS is nil
1 parent fb1515b commit 7396430

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

http/handler.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,11 @@ func WrapForwardedForHandler(h http.Handler, l *configutil.Listener) http.Handle
543543
client_certs = append(client_certs, cert)
544544
}
545545
}
546-
r.TLS.PeerCertificates = client_certs
546+
if r.TLS == nil {
547+
respondError(w, http.StatusBadRequest, fmt.Errorf("Server must use TLS for certificate authentication"))
548+
} else {
549+
r.TLS.PeerCertificates = client_certs
550+
}
547551
}
548552
h.ServeHTTP(w, r)
549553
return

0 commit comments

Comments
 (0)