mirror of
https://gitee.com/johng/gf
synced 2026-07-09 06:50:30 +08:00
fix(ghttp): resolve the issue where the GetCertificate callback in TLS listener gets overwritten (#4789)
This commit is contained in:
@ -222,7 +222,7 @@ func (s *Server) CreateListenerTLS(certFile, keyFile string, tlsConfig ...*tls.C
|
||||
config.NextProtos = []string{"http/1.1"}
|
||||
}
|
||||
var err error
|
||||
if len(config.Certificates) == 0 {
|
||||
if len(config.Certificates) == 0 && config.GetCertificate == nil {
|
||||
config.Certificates = make([]tls.Certificate, 1)
|
||||
if gres.Contains(certFile) {
|
||||
config.Certificates[0], err = tls.X509KeyPair(
|
||||
|
||||
Reference in New Issue
Block a user