First step was to set up the ACME server in the frontend Caddyfile.
# ACME server
caddy.lan {
acme_server
tls internal
}
My first stumbling block. ā¦ I reload Caddy. Checking the log, I note errors around NSS support:
{"level":"warn","ts":"2021-05-04T14:29:41.537+0800","msg":"exiting; byeee!! š","signal":"SIGTERM"}
{"level":"info","ts":"2021-05-04T14:29:42.094+0800","logger":"tls.cache.maintenance","msg":"stopped background certificate maintenance","cache":"0xc00010a230"}
{"level":"info","ts":"2021-05-04T14:29:42.096+0800","logger":"admin","msg":"stopped previous server","address":"tcp/localhost:2019"}
{"level":"info","ts":"2021-05-04T14:29:42.096+0800","msg":"shutdown complete","signal":"SIGTERM","exit_code":0}
{"level":"info","ts":1620109782.231529,"msg":"using provided configuration","config_file":"/usr/local/www/Caddyfile","config_adapter":"caddyfile"}
{"level":"warn","ts":1620109782.2527225,"msg":"input is not formatted with 'caddy fmt'","adapter":"caddyfile","file":"/usr/local/www/Caddyfile","line":2}
{"level":"info","ts":"2021-05-04T14:29:42.263+0800","logger":"admin","msg":"admin endpoint started","address":"tcp/localhost:2019","enforce_origin":false,"origins":["localhost:2019","[::1]:2019","127.0.0.1:2019"]}
{"level":"info","ts":"2021-05-04T14:29:42.264+0800","logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc0003bdf80"}
{"level":"info","ts":"2021-05-04T14:29:42.296+0800","logger":"http","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
{"level":"info","ts":"2021-05-04T14:29:42.296+0800","logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
{"level":"info","ts":"2021-05-04T14:29:56.456+0800","logger":"http","msg":"enabling automatic TLS certificate management","domains":["caffigoalkeeping.com.au","caffigoalkeeping.com","www.readymcgetty.com.au","readymcgetty.com.au","www.udance.com.au","caddy.lan","www.caffigoalkeeping.com.au","udance.com.au","*.udance.com.au","www.caffigoalkeeping.com","www.xenografix.com.au","xenografix.com.au"]}
{"level":"warn","ts":"2021-05-04T14:29:56.478+0800","logger":"tls","msg":"stapling OCSP","error":"no OCSP stapling for [caddy.lan]: no OCSP server specified in certificate"}
{"level":"warn","ts":"2021-05-04T14:29:56.539+0800","logger":"pki.ca.local","msg":"installing root certificate (you might be prompted for password)","path":"storage:pki/authorities/local/root.crt"}
2021/05/04 14:29:56 define JAVA_HOME environment variable to use the Java trust
2021/05/04 14:29:56 Note: NSS support is not available on your platform
{"level":"error","ts":"2021-05-04T14:29:56.539+0800","logger":"pki.ca.local","msg":"failed to install root certificate","error":"trust not supported","certificate_file":"storage:pki/authorities/local/root.crt"}
{"level":"info","ts":"2021-05-04T14:29:56.539+0800","logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/.local/share/caddy"}
{"level":"info","ts":"2021-05-04T14:29:56.540+0800","msg":"autosaved config (load with --resume flag)","file":"/.config/caddy/autosave.json"}
{"level":"info","ts":"2021-05-04T14:29:56.540+0800","msg":"serving initial configuration"}
Successfully started Caddy (pid=30573) - Caddy is running in the background
Is there a package dependency here? Maybe I need to install additional packages to support mTLS, though Iām not sure what they might be?
Just to be sure the lines added to the Caddyfile were causing the issue, I temporarily commented them out and restarted Caddy. The log shows no errors.
{"level":"info","ts":"2021-05-04T18:19:22.511+0800","msg":"shutting down apps, then terminating","signal":"SIGTERM"}
{"level":"warn","ts":"2021-05-04T18:19:22.511+0800","msg":"exiting; byeee!! š","signal":"SIGTERM"}
{"level":"info","ts":"2021-05-04T18:19:22.794+0800","logger":"tls.cache.maintenance","msg":"stopped background certificate maintenance","cache":"0xc0001e0700"}
{"level":"info","ts":"2021-05-04T18:19:22.796+0800","logger":"admin","msg":"stopped previous server","address":"tcp/localhost:2019"}
{"level":"info","ts":"2021-05-04T18:19:22.796+0800","msg":"shutdown complete","signal":"SIGTERM","exit_code":0}
{"level":"info","ts":1620123562.9296148,"msg":"using provided configuration","config_file":"/usr/local/www/Caddyfile","config_adapter":"caddyfile"}
{"level":"warn","ts":1620123562.9503217,"msg":"input is not formatted with 'caddy fmt'","adapter":"caddyfile","file":"/usr/local/www/Caddyfile","line":2}
{"level":"info","ts":"2021-05-04T18:19:22.958+0800","logger":"admin","msg":"admin endpoint started","address":"tcp/localhost:2019","enforce_origin":false,"origins":["localhost:2019","[::1]:2019","127.0.0.1:2019"]}
{"level":"info","ts":"2021-05-04T18:19:22.959+0800","logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc0003b2620"}
{"level":"info","ts":"2021-05-04T18:19:22.960+0800","logger":"http","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
{"level":"info","ts":"2021-05-04T18:19:22.960+0800","logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
{"level":"info","ts":"2021-05-04T18:19:36.410+0800","logger":"http","msg":"enabling automatic TLS certificate management","domains":["www.xenografix.com.au","readymcgetty.com.au","www.caffigoalkeeping.com","xenografix.com.au","caffigoalkeeping.com","www.readymcgetty.com.au","caffigoalkeeping.com.au","udance.com.au","*.udance.com.au","www.caffigoalkeeping.com.au","www.udance.com.au"]}
{"level":"info","ts":"2021-05-04T18:19:36.409+0800","logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/.local/share/caddy"}
{"level":"info","ts":"2021-05-04T18:19:36.438+0800","logger":"tls","msg":"finished cleaning storage units"}
{"level":"info","ts":"2021-05-04T18:19:36.457+0800","msg":"autosaved config (load with --resume flag)","file":"/.config/caddy/autosave.json"}
{"level":"info","ts":"2021-05-04T18:19:36.457+0800","msg":"serving initial configuration"}
Successfully started Caddy (pid=68418) - Caddy is running in the background