aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatt Holt <[email protected]>2023-05-13 07:09:20 -0600
committerGitHub <[email protected]>2023-05-13 07:09:20 -0600
commita02ecb0f88cb1c290c0cf940431aff8a6e1891ed (patch)
treebece6ed24093e46daec50a335e71b4c948a64310
parent5ebb7d496da765fd0263161cd306ecf86b609485 (diff)
downloadcaddy-a02ecb0f88cb1c290c0cf940431aff8a6e1891ed.tar.gz
caddy-a02ecb0f88cb1c290c0cf940431aff8a6e1891ed.zip
caddytls: Check for nil ALPN; close #5470 (#5473)
* Check for nil ALPN; close #5470 * Apply patch * Actually I want to try this
-rw-r--r--modules/caddytls/connpolicy.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/caddytls/connpolicy.go b/modules/caddytls/connpolicy.go
index 46a8eda39..a4dc4119d 100644
--- a/modules/caddytls/connpolicy.go
+++ b/modules/caddytls/connpolicy.go
@@ -54,7 +54,7 @@ func (cp ConnectionPolicies) Provision(ctx caddy.Context) error {
}
// enable HTTP/2 by default
- if len(pol.ALPN) == 0 {
+ if pol.ALPN == nil {
pol.ALPN = append(pol.ALPN, defaultALPN...)
}
@@ -283,7 +283,7 @@ func (p *ConnectionPolicy) buildStandardTLSConfig(ctx caddy.Context) error {
break
}
}
- if !alpnFound {
+ if !alpnFound && (cfg.NextProtos == nil || len(cfg.NextProtos) > 0) {
cfg.NextProtos = append(cfg.NextProtos, acmez.ACMETLS1Protocol)
}