summaryrefslogtreecommitdiff
path: root/modules/caddytls
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-04-29 09:22:00 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-04-29 09:22:00 -0600
commit5859cd8dad32fdd7ea55daa5e4377e273fb97a3e (patch)
tree7237ca3c4c1de7f00ca508306b9ef7e427b5553c /modules/caddytls
parent43961b542b077f99f78d64629348b9300d3cd4a3 (diff)
Instantiate apps that are needed but not explicitly configured
Diffstat (limited to 'modules/caddytls')
-rw-r--r--modules/caddytls/connpolicy.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/caddytls/connpolicy.go b/modules/caddytls/connpolicy.go
index 9400034..a085fa3 100644
--- a/modules/caddytls/connpolicy.go
+++ b/modules/caddytls/connpolicy.go
@@ -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,