1. The problem I’m having:
I was trying to force the usage of https for local domain/access running Vaultwarden and Caddy via docker.
Starting up Caddy container will result in the subject error
2. Error messages and/or full log output:
Error: sending configuration to instance: caddy responded with error: HTTP 400: {"error":"loading config: loading new config: loading http app module: provision http: getting tls app: loading tls app module: provision tls: loading certificates: open /etc/ssl/certs/_wildcard.cccc.nord.pem: no such file or directory
3. Caddy version:
docker exec caddy caddy version
v2.6.4 h1:2hwYqiRwk1tf3VruhMpLcYTg+11fCdr8S3jhNAdnPy8=
4. How I installed and ran Caddy:
docker-compose.yml
a. System environment:
Ubuntu 20.4 LTS
b. Command:
docker compose up -d
c. Service/unit/compose file:
d. My complete Caddy config:
v.cccc.nord {
encode gzip
# Uncomment to improve security (WARNING: only use if you understand the implications!)
# If you want to use FIDO2 WebAuthn, set X-Frame-Options to "SAMEORIGIN" or the Browser >
header {
# Enable HTTP Strict Transport Security (HSTS)
Strict-Transport-Security "max-age=31536000;"
# Enable cross-site filter (XSS) and tell browser to block detected attacks
X-XSS-Protection "1; mode=block"
# Disallow the site to be rendered within a frame (clickjacking protection)
X-Frame-Options "DENY"
# Prevent search engines from indexing (optional)
X-Robots-Tag "none"
# Server name removing
-Server
}
tls /etc/ssl/certs/_wildcard.cccc.nord.pem /etc/ssl/certs/_wildcard.cccc.nord.key.pem
# Notifications redirected to the websockets server
#reverse_proxy /notifications/hub localhost:3012
# Proxy everything else to Rocket
reverse_proxy localhost:8080 {
# Send the true remote IP to Rocket, so that vaultwarden can put this in the
# log, so that fail2ban can ban the correct IP.
header_up X-Real-IP {remote_host}
}
}
5. Links to relevant resources:
I have searched and found this topic SSL Configuration in Caddy . It appeared not different from what I was doing.
I have used ‘mkcert’ to generate the certificates for the local domain “cccc.nord” and copied them into /etc/ssl/certs directory
Could it be a permission issue? How does Caddy search for files in TLS directive?
ls -l /etc/ssl/certs/_w
-rw-r--r-- 1 root root 1704 Jun 18 03:14 /etc/ssl/certs/_wildcard.cccc.nord-key.pem
-rw-r--r-- 1 root root 1468 Jun 18 03:14 /etc/ssl/certs/_wildcard.cccc.nord.pem