Instantiate apps that are needed but not explicitly configured

This commit is contained in:
Matthew Holt 2019-04-29 09:22:00 -06:00
parent 43961b542b
commit 5859cd8dad
4 changed files with 44 additions and 19 deletions

View file

@ -75,7 +75,11 @@ type ConnectionPolicy struct {
}
func (cp *ConnectionPolicy) buildStandardTLSConfig(handle caddy2.Handle) error {
tlsApp := handle.App("tls").(*TLS)
tlsAppIface, err := handle.App("tls")
if err != nil {
return fmt.Errorf("getting tls app: %v", err)
}
tlsApp := tlsAppIface.(*TLS)
cfg := &tls.Config{
NextProtos: cp.ALPN,