Too many colons in address (caddy 2.11.1)

1. The problem I’m having:

On my Debian VPS I noticed today that there’s an update to v2.11.1 available. I then built the version with xcaddy. Since then, I was unable to open a web page on my VPS (Stalwart web admin, 502 error). Going back to v2.10.2 and everything was ok again.

2. Error messages and/or full log output:

caddy[1062]: {"level":"error","ts":1771670957.2426953,"logger":"http.log.error","msg":"address [[2003:de:ef0b:2a00:c4d7:7c34:2437:ab8b]:0->127.0.0.1]:10443: too many colons in address","request":{"remote_ip":"2003:de:ef0b:2a00:c4d7:7c34:2437:ab8b","remote_port":"57734","client_ip":"2003:de:ef0b:2a00:c4d7:7c34:2437:ab8b","proto":"HTTP/2.0","method":"GET","host":"mail.brodbeck-online.de","uri":"/","headers":{"Priority":["u=0, i"],"User-Agent":["Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36"],"Sec-Fetch-User":["?1"],"Sec-Ch-Ua-Mobile":["?0"],"Sec-Ch-Ua-Platform":["\"Linux\""],"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8"],"Sec-Gpc":["1"],"Sec-Fetch-Mode":["navigate"],"Sec-Fetch-Dest":["document"],"Accept-Encoding":["gzip, deflate, br, zstd"],"Sec-Ch-Ua":["\"Not:A-Brand\";v=\"99\", \"Brave\";v=\"145\", \"Chromium\";v=\"145\""],"Upgrade-Insecure-Requests":["1"],"Sec-Fetch-Site":["none"],"Accept-Language":["de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"mail.brodbeck-online.de","ech":false}},"duration":0.000525456,"status":502,"err_id":"4h0temfi8","err_trace":"reverseproxy.statusError (reverseproxy.go:1473)"}

3. Caddy version:

v2.11.1

4. How I installed and ran Caddy:

xcaddy build \
    --with github.com/mholt/caddy-l4/modules/l4proxy \
    --with github.com/mholt/caddy-l4/modules/l4tls \
    --with github.com/mholt/caddy-l4/modules/l4proxyprotocol

Then using update-alternatives as described here.

a. System environment:

Debian 13, x86_64

b. Command:

Just using systemd

c. Service/unit/compose file:

Using the default systemd file from the Debian package.

d. My complete Caddy config:

# BEGIN HEADER
{
        layer4 {
                # BEGIN Stalwart Mail Server
                0.0.0.0:25 {
                        route {
                                proxy {
                                        proxy_protocol v2
                                        upstream localhost:10025
                                }
                        }
                }

                0.0.0.0:993 {
                        route {
                                proxy {
                                        proxy_protocol v2
                                        upstream localhost:10993
                                }
                        }
                }

                0.0.0.0:465 {
                        route {
                                proxy {
                                        proxy_protocol v2
                                        upstream localhost:10465
                                }
                        }
                }

                0.0.0.0:587 {
                        route {
                                proxy {
                                        proxy_protocol v2
                                        upstream localhost:10587
                                }
                        }
                }

                0.0.0.0:4190 {
                        route {
                                proxy {
                                        proxy_protocol v2
                                        upstream localhost:14190
                                }
                        }
                }
                # END Stalwart Mail Server
        }
}
# END HEADER

# Stalwart Mail Server
brodbeck-online.de {
        root * /usr/share/caddy
        file_server
}
mail.brodbeck-online.de {
        reverse_proxy https://127.0.0.1:10443 {
                transport http {
                        proxy_protocol v2
                        tls_server_name mail.brodbeck-online.de
                }
        }
}

5. Links to relevant resources:

This is suspicious

[[2003:de:ef0b:2a00:c4d7:7c34:2437:ab8b]:0->127.0.0.1]:10443

I have a fix incoming. A fix for keep-alive had an unintended side effect when proxy protocol is used with HTTPS. Sorry.

1 Like

fix heree

2 Likes

Thanks for the quick fix, @Mohammed90. I’ll try again with v2.11.2.

1 Like