Skip to content

Commit b8ad90c

Browse files
committed
cmd/derper: in manual cert mode, don't discard error from VerifyHostname
Updates tailscale#3701 Change-Id: If8ca5104bd8221c99cc390ca49ee3401aff09b62 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
1 parent b1b0fd1 commit b8ad90c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/derper/cert.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ func NewManualCertManager(certdir, hostname string) (certProvider, error) {
6767
if err != nil {
6868
return nil, fmt.Errorf("can not load cert: %w", err)
6969
}
70-
if x509Cert.VerifyHostname(hostname) != nil {
71-
return nil, errors.New("refuse to load cert: hostname mismatch with key")
70+
if err := x509Cert.VerifyHostname(hostname); err != nil {
71+
return nil, fmt.Errorf("cert invalid for hostname %q: %w", hostname, err)
7272
}
7373
return &manualCertManager{cert: &cert, hostname: hostname}, nil
7474
}

0 commit comments

Comments
 (0)