Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 14, 05:15 UTC
Fix for last commit
Matthew Holt committed
Apr 1, 2020 at 21:07 UTC
626f19a264aacd996526695c789ef64532f1494c
1 file changed
+8
-1
modules/caddytls/connpolicy.go
+8
-1
@@ -171,7 +171,14 @@ func (p *ConnectionPolicy) buildStandardTLSConfig(ctx caddy.Context) error {
171
// more at handshake-time, but I don't know how to practically pre-build
172
// a certmagic config for each combination of conn policy + automation policy...
173
cfg := *tlsApp.getConfigForName(hello.ServerName)
174
- cfg.CertSelection = p.CertSelection
174
+ if p.CertSelection != nil {
175
+ // you would think we could just set this whether or not
176
+ // p.CertSelection is nil, but that leads to panics if
177
+ // it is, because cfg.CertSelection is an interface,
178
+ // so it will have a non-nil value even if the actual
179
+ // value underlying it is nil (sigh)
180
+ cfg.CertSelection = p.CertSelection
181
+ }
182
cfg.DefaultServerName = p.DefaultSNI
183
return cfg.GetCertificate(hello)
184
},