feat:根据SNI返回SSL证书

This commit is contained in:
deny
2023-04-17 11:07:39 +00:00
parent 8798de0d6d
commit 609a893feb
4 changed files with 74 additions and 9 deletions

View File

@@ -49,8 +49,8 @@ func startTls() {
NextProtos: []string{"http/1.1"},
MinVersion: tls.VersionTLS12,
CipherSuites: selectedCipherSuites,
GetCertificate: func(*tls.ClientHelloInfo) (*tls.Certificate, error) {
return dbdata.TLSCert, nil
GetCertificate: func(chi *tls.ClientHelloInfo) (*tls.Certificate, error) {
return dbdata.GetCertificateBySNI(chi.ServerName)
},
// InsecureSkipVerify: true,
}