aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/caddyhttp
diff options
context:
space:
mode:
authorAaron Paterson <[email protected]>2024-10-01 01:47:21 -0400
committerGitHub <[email protected]>2024-10-01 01:47:21 -0400
commit0e829bc4187e265d1e4ccb1bec24996088acf0a5 (patch)
treed03adbdaa5b9afbd0306e8bd4194b381dadf514e /modules/caddyhttp
parent4b1a9b6cc1aa521e21289afa276d29952a97d8f3 (diff)
downloadcaddy-0e829bc4187e265d1e4ccb1bec24996088acf0a5.tar.gz
caddy-0e829bc4187e265d1e4ccb1bec24996088acf0a5.zip
caddyhttp: Fix listener wrapper regression from #6573 (#6599)
Diffstat (limited to 'modules/caddyhttp')
-rw-r--r--modules/caddyhttp/app.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/caddyhttp/app.go b/modules/caddyhttp/app.go
index 673ebcb8e..7a5c10623 100644
--- a/modules/caddyhttp/app.go
+++ b/modules/caddyhttp/app.go
@@ -535,11 +535,6 @@ func (app *App) Start() error {
return fmt.Errorf("network '%s' cannot handle HTTP/1 or HTTP/2 connections", listenAddr.Network)
}
- if useTLS {
- // create TLS listener - this enables and terminates TLS
- ln = tls.NewListener(ln, tlsCfg)
- }
-
// wrap listener before TLS (up to the TLS placeholder wrapper)
var lnWrapperIdx int
for i, lnWrapper := range srv.listenerWrappers {
@@ -550,6 +545,11 @@ func (app *App) Start() error {
ln = lnWrapper.WrapListener(ln)
}
+ if useTLS {
+ // create TLS listener - this enables and terminates TLS
+ ln = tls.NewListener(ln, tlsCfg)
+ }
+
// finish wrapping listener where we left off before TLS
for i := lnWrapperIdx; i < len(srv.listenerWrappers); i++ {
ln = srv.listenerWrappers[i].WrapListener(ln)