File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ func (cfg *Config) getCertificateFromCache(hello *tls.ClientHelloInfo) (cert Cer
123123 }
124124 }
125125
126- // fall back to a "default" certificate, if specified
126+ // use a "default" certificate by name , if specified
127127 if cfg .DefaultServerName != "" {
128128 normDefault := normalizedName (cfg .DefaultServerName )
129129 cert , defaulted = cfg .selectCert (hello , normDefault )
@@ -835,10 +835,13 @@ func (cfg *Config) getTLSALPNChallengeCert(clientHello *tls.ClientHelloInfo) (*t
835835// getNameFromClientHello returns a normalized form of hello.ServerName.
836836// If hello.ServerName is empty (i.e. client did not use SNI), then the
837837// associated connection's local address is used to extract an IP address.
838- func (* Config ) getNameFromClientHello (hello * tls.ClientHelloInfo ) string {
838+ func (cfg * Config ) getNameFromClientHello (hello * tls.ClientHelloInfo ) string {
839839 if name := normalizedName (hello .ServerName ); name != "" {
840840 return name
841841 }
842+ if cfg .DefaultServerName != "" {
843+ return normalizedName (cfg .DefaultServerName )
844+ }
842845 return localIPFromConn (hello .Conn )
843846}
844847
You can’t perform that action at this time.
0 commit comments