@marcel91200 / caddy Mirror · read-only / commits / a02ecb0f
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 13, 03:00 UTC

caddytls: Check for nil ALPN; close #5470 (#5473)

* Check for nil ALPN; close #5470 * Apply patch * Actually I want to try this

Matt Holt committed May 13, 2023 at 07:09 UTC a02ecb0f88cb1c290c0cf940431aff8a6e1891ed
1 file changed +2 -2
modules/caddytls/connpolicy.go
+2 -2
@@ -54,7 +54,7 @@ func (cp ConnectionPolicies) Provision(ctx caddy.Context) error {
54 }
55
56 // enable HTTP/2 by default
57 - if len(pol.ALPN) == 0 {
57 + if pol.ALPN == nil {
58 pol.ALPN = append(pol.ALPN, defaultALPN...)
59 }
60
@@ -283,7 +283,7 @@ func (p *ConnectionPolicy) buildStandardTLSConfig(ctx caddy.Context) error {
283 break
284 }
285 }
286 - if !alpnFound {
286 + if !alpnFound && (cfg.NextProtos == nil || len(cfg.NextProtos) > 0) {
287 cfg.NextProtos = append(cfg.NextProtos, acmez.ACMETLS1Protocol)
288 }
289