1. Caddy version (caddy version
):
v2.4.5
2. How I run Caddy:
a. System environment:
Ubuntu, 20.4, Nob. Command:
Sudo Systemctl enable caddy-api
curl localhost:2019/load \
-X POST \
-H "Content-Type: application/json" \
-d @caddy.json
curl localhost:2019/config/
c. Service/unit/compose file:
NoPaste full file contents here.
Make sure backticks stay on their own lines,
and the post looks nice in the preview pane.
d. My complete Caddyfile or JSON config:
{
"admin": {
"disabled": false
},
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [
":443"
],
"routes": [
{
"handle": [
{
"handler": "headers",
"response": {
"set": {
"Referrer-Policy": [
"same-origin"
],
"X-Content-Type-Options": [
"nosniff"
],
"X-Frame-Options": [
"DENY"
],
"X-Xss-Protection": [
"1; mode=block"
]
}
}
},
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "vars",
"root": "/var/www/html/example/"
}
]
},
{
"handle": [
{
"handler": "rewrite",
"uri": "{http.matchers.file.relative}"
}
],
"match": [
{
"file": {
"try_files": [
"{http.request.uri.path}",
"{http.request.uri.path}/",
"/index.html"
]
}
}
]
},
{
"handle": [
{
"encodings": {
"gzip": {},
"zstd": {}
},
"handler": "encode"
},
{
"handler": "file_server",
"hide": [
"Caddyfile"
]
}
]
}
]
}
]
}
]
}
}
},
"tls": {
"automation": {
"on_demand": {
"ask": "example.com"
},
"policies": [
{
"on_demand": true
}
]
}
}
}
}
3. The problem Iâm having:
- Trying 127.0.0.1:443âŚ
- TCP_NODELAY set
- Connected to localhost (127.0.0.1) 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):
- TLSv1.3 (IN), TLS alert, internal error (592):
- error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error
- Closing connection 0
curl: (35) error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error
4. Error messages and/or full log output:
5. What I already tried:
Changed port to 80 and it works fine with 80, but not with 443