diff --git a/caddytls/handshake.go b/caddytls/handshake.go index 2f3f34af3..841d06cd0 100644 --- a/caddytls/handshake.go +++ b/caddytls/handshake.go @@ -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