1. The problem I’m having:
I am deploying Caddy to Vultr via a Docker image. Using Caddyfiles, no issues with on-demand certificates, moved to JSON via MySQL adapter, issues caused.
2. Error messages and/or full log output:
There are literally zero errors in the caddy logs with debug enabled.
Only errors received are via browser when accessing the domain:
sent an invalid response.
ERR_SSL_PROTOCOL_ERROR
and via curl:
C:\Users\xxx>curl -I -k https://redacted.io
curl: (35) schannel: next InitializeSecurityContext failed: SEC_E_ILLEGAL_MESSAGE (0x80090326) - This error usually occurs when a fatal SSL/TLS alert is received (e.g. handshake failed). More detail may be available in the Windows System event log.
3. Caddy version:
Docker, latest.
4. How I installed and ran Caddy:
Docker.
b. Command:
[supervisord]
nodaemon=true
user=root
logfile=/dev/stdout
logfile_maxbytes=0
pidfile=/var/run/supervisord.pid
[program:caddy]
command=caddy run --adapter mysql --config /usr/bin/mysql.json
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:optimizer]
command=/usr/local/bin/optimizer
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
c. Service/unit/compose file:
version: '3.8'
services:
app:
build: .
ports:
- "80:80"
- "443:443"
- "443:443/udp"
- "3001:3001"
- "2019:2019"
volumes:
- ./mysql.json:/usr/bin/mysql.json
restart: unless-stopped
d. My complete Caddy config:
config.app
{
"http": {
"http_port": 80,
"https_port": 443,
"servers": {
"srv0": {
"listen": [
":443",
":80"
],
"protocols": [
"h1",
"h2",
"h3"
]
}
}
},
"cache": {
"allowed_http_verbs": [
"GET",
"HEAD"
],
"cache_name": "Redis-Proxy",
"default_cache_control": "public, max-age=7200",
"distributed": true,
"mode": "bypass",
"redis": {
"found": true,
"configuration": {
"AlwaysPipelining": true,
"ClientName": "redacted",
"DisableTCPNoDelay": "true",
"InitAddress": [
"redacted"
]
}
},
"timeout": {
"backend": "0s",
"cache": "0s"
},
"ttl": "10s"
},
"tls": {
"automation": {
"policies": [
{
"on_demand": true
}
],
"on_demand": {
"permission": {
"module": "http",
"endpoint": "https://redacted.io/try/ssl.php"
}
}
}
}
}
config.apps.http.servers.srv0.routes
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "encode",
"encodings": {
"zstd": {
"level": "fastest"
},
"gzip": {
"level": 1
}
},
"prefer": [
"zstd"
]
},
{
"handler": "cache",
"cache_name": "Redis-Proxy"
},
{
"handler": "reverse_proxy",
"headers": {
"request": {
"set": {
"Host": [
"redacted.io"
]
}
}
},
"upstreams": [
{
"dial": "7x.6x.x1.xxx:80"
}
]
}
]
}
]
}
],
"match": [
{
"host": [
"redacted.io"
]
}
]
}