From 23b60beb39f0bcc2a141be8cacf99989f327912e Mon Sep 17 00:00:00 2001 From: pooneh-m <46979170+pooneh-m@users.noreply.github.com> Date: Mon, 14 Sep 2020 01:56:59 -0700 Subject: [PATCH] Update main.go (#1812) Add logging for the client certificate verification. --- cmd/allocator/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/allocator/main.go b/cmd/allocator/main.go index 35475c8486..b4035265ce 100644 --- a/cmd/allocator/main.go +++ b/cmd/allocator/main.go @@ -295,6 +295,7 @@ func (h *serviceHandler) verifyClientCertificate(rawCerts [][]byte, verifiedChai c, err := x509.ParseCertificate(rawCerts[0]) if err != nil { + logger.WithError(err).Warning("cannot parse client certificate") return errors.New("bad client certificate: " + err.Error()) } @@ -302,6 +303,7 @@ func (h *serviceHandler) verifyClientCertificate(rawCerts [][]byte, verifiedChai defer h.certMutex.RUnlock() _, err = c.Verify(opts) if err != nil { + logger.WithError(err).Warning("failed to verify client certificate") return errors.New("failed to verify client certificate: " + err.Error()) } return nil