From 9418d7190b17f531ad27b767b25c2218d1845adb Mon Sep 17 00:00:00 2001 From: PercivalZhou Date: Thu, 27 Mar 2025 06:00:44 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20cmd/derper/cert.go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将与域名验证相关的内容删除或注释 --- cmd/derper/cert.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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 {