ITADN

Using both TLS SNI and Caddy services on SSL causes intermittent issues

#375Openpmdevita 创建于 2026-02-01
P
pmdevitacommented
Apologies for this if I just misunderstood something or got something wrong. I'm using Caddy to reverse proxy multiple services on a server, including both LANCache and Docker registry. In order to handle https for the LanCache domains, I'm using layer4 with TLS SNI to route them to their real host. My Caddy config looks something like this. ``` { layer4 { :443 { @lancache_domains tls sni *.unrealengine.com route @lancache_domains { proxy tcp/{l4.tls.server_name}:443 } } } docker.mydomain.com { reverse_proxy registry:5000 } } ``` However, with the layer4 section added, I begin to get intermittent issues from the Docker registry and other SSL services behind Caddy. Docker fails to push images with an EOF error. Curl also fails to get pages about 50% of the time, I can spam the command and get different results. These failures happen both for reverse proxied services and the domains getting routed through layer4 TLS SNI. ``` curl -v -k https://mydomain.com * Host mydomain.com:443 was resolved. * IPv6: (none) * IPv4: xxx.xxx.xxx.xxx * Trying xxx.xxx.xxx.xxx:443... * ALPN: curl offers h2,http/1.1 * TLSv1.3 (OUT), TLS handshake, Client hello (1): * SSL Trust Anchors: * CAfile: /etc/ssl/certs/ca-certificates.crt * TLSv1.3 (OUT), TLS alert, decode error (562): * TLS connect error: error:0A000126:SSL routines::unexpected eof while reading * closing connection #0 curl: (35) TLS connect error: error:0A000126:SSL routines::unexpected eof while reading ``` ``` sudo docker push docker.mydomain.com/hello-world Using default tag: latest The push refers to repository [docker.mydomain.com/hello-world] Get "https://docker.mydomain.com/v2/": EOF ``` That all being said, I can visit https://docker.mydomain.com/v2 or cdn2.unrealengine.com in Firefox and get a 200 response. It seems strange that it works for some programs some of the time, but is this expected behavior or did I configure something wrong? Thank you!
1 条评论