You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting TLS errors when using this plugin (I stripped IP addresses for privacy concerns):
$ curl -v https://xxx.yyy/
* Trying xxx.xxx.xxx.x:443...
* TCP_NODELAY set* Connected to xxx.yyy (xxx.xxx.xxx.x) port 443 (#0)* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to xxx.yyy:443
* Closing connection 0
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to xxx.yyy:443
{"level":"debug","ts":1662558661.0007904,"logger":"http.stdlib","msg":"http: TLS handshake error from xx.xxx.xxx.xxx:3803: invalid signature"}
Here is my caddyfile:
{
debug servers {
listener_wrappers {
proxy_protocol {
timeout 5s
allow 0.0.0.0/0
}
tls
}
}
}
xxx.yyy {
reverse_proxy sftpgo:8080 # I run this in docker-compose, so sftpgo is a docker containe
}
This error was happening for me when the request coming in to caddy did not include the PROXY protocol header. You can use the --haproxy-protocol flag for curl to test this.
As an earlier comment says, the solution is to ensure that the allow directive specifies only IP addresses of your trusted proxies, and that they are always sending the PROXY protocol data.
Activity
Anduin2017 commentedon Oct 7, 2022
Same here.
Anduin2017 commentedon Oct 7, 2022
Hi, @paullaffitte I finally solved this!
The solution is: Set the
allowattribute to use this plugin only when the request is coming from the trusted reverse proxy server IP.For example, I'm using frp as a reverse proxy. And it works at
127.0.0.1. So I set it as:{ servers :443 { listener_wrappers { proxy_protocol { timeout 2s allow 127.0.0.1/32 } http_redirect tls } } }After that, my direct HTTP request won't hit this plugin and doesn't have this issue.
plaffitt commentedon Oct 14, 2022
In my case, caddy is my reverse proxy server, so it doesn't work for me.
mwild1 commentedon Mar 18, 2025
This error was happening for me when the request coming in to caddy did not include the PROXY protocol header. You can use the
--haproxy-protocolflag for curl to test this.As an earlier comment says, the solution is to ensure that the
allowdirective specifies only IP addresses of your trusted proxies, and that they are always sending the PROXY protocol data.