diff --git a/cmd/derper/cert.go b/cmd/derper/cert.go index b95755c64..7cd4810f2 100644 --- a/cmd/derper/cert.go +++ b/cmd/derper/cert.go @@ -128,16 +128,17 @@ func (m *manualCertManager) TLSConfig() *tls.Config { } func (m *manualCertManager) getCertificate(hi *tls.ClientHelloInfo) (*tls.Certificate, error) { - if hi.ServerName != m.hostname && !m.noHostname { - return nil, fmt.Errorf("cert mismatch with hostname: %q", hi.ServerName) - } + // if hi.ServerName != m.hostname && !m.noHostname { + // return nil, fmt.Errorf("cert mismatch with hostname: %q", hi.ServerName) + // } // Return a shallow copy of the cert so the caller can append to its // Certificate field. - certCopy := new(tls.Certificate) - *certCopy = *m.cert - certCopy.Certificate = certCopy.Certificate[:len(certCopy.Certificate):len(certCopy.Certificate)] - return certCopy, nil + // certCopy := new(tls.Certificate) + // *certCopy = *m.cert + // certCopy.Certificate = certCopy.Certificate[:len(certCopy.Certificate):len(certCopy.Certificate)] + // return certCopy, nil + return m.cert, nil } func (m *manualCertManager) HTTPHandler(fallback http.Handler) http.Handler {