diff options
author | Matt Holt <mholt@users.noreply.github.com> | 2023-05-13 07:09:20 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-13 07:09:20 -0600 |
commit | a02ecb0f88cb1c290c0cf940431aff8a6e1891ed (patch) | |
tree | bece6ed24093e46daec50a335e71b4c948a64310 | |
parent | 5ebb7d496da765fd0263161cd306ecf86b609485 (diff) |
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.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/caddytls/connpolicy.go b/modules/caddytls/connpolicy.go index 46a8eda..a4dc411 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) } |