@marcel91200 / caddy Mirror · read-only / commits / 105eee67
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 12, 00:45 UTC

caddytls: Set local_ip, not remote_ip (#6952)

Follow-up on 35c8c2d92d26208642cea0d1549c77a00124e154 where I was a dum-dum

Matthew Holt committed Apr 21, 2025 at 18:32 UTC 105eee671c384459de666889be953857a7175afa
1 file changed +3 -3
modules/caddytls/certmanagers.go
+3 -3
@@ -144,9 +144,9 @@ func (hcg HTTPCertGetter) GetCertificate(ctx context.Context, hello *tls.ClientH
144 qs.Set("server_name", hello.ServerName)
145 qs.Set("signature_schemes", strings.Join(sigs, ","))
146 qs.Set("cipher_suites", strings.Join(suites, ","))
147 - remoteIP, _, err := net.SplitHostPort(hello.Conn.RemoteAddr().String())
148 - if err == nil && remoteIP != "" {
149 - qs.Set("remote_ip", remoteIP)
147 + localIP, _, err := net.SplitHostPort(hello.Conn.LocalAddr().String())
148 + if err == nil && localIP != "" {
149 + qs.Set("local_ip", localIP)
150 }
151 parsed.RawQuery = qs.Encode()
152