tls: Try empty name if no matches for getting config during handshake

See discussion on #2015; the initial change had removed this check, and
I can't remember why I removed it or if it was accidental. Anyway, it's
back now.
This commit is contained in:
Matthew Holt 2018-02-15 08:48:05 -07:00
parent be96cc0e65
commit 896dc6bc69
No known key found for this signature in database
GPG Key ID: 2A349DD577D586A5

View File

@ -59,6 +59,14 @@ func (cg configGroup) getConfig(name string) *Config {
}
}
// try a config that serves all names (this
// is basically the same as a config defined
// for "*" -- I think -- but the above loop
// doesn't try an empty string)
if config, ok := cg[""]; ok {
return config
}
// no matches, so just serve up a random config
for _, config := range cg {
return config