Caddy enables automatic TLS cert management, invalid "localhost" certificate is used

1. Caddy version (v2.4.0 h1:yHnnbawH2G3ZBP2mAJF4XBLnJanqhULLP/wu01Qi9Io=):

2. How I run Caddy:

a. System environment:

Windows 10

b. Command:

caddy run

c. Service/unit/compose file:

N/A

d. My complete Caddyfile or JSON config:

1312.gay

file_server

3. The problem I’m having:

hi, i heard SSL is default on Caddy, however when i visit https://1312.gay, the certificate is not trusted. Firefox displays the following information about the certificate:

curl -v output:

curl -v https://1312.gay
* Rebuilt URL to: https://1312.gay/
*   Trying 86.160.55.49...
* TCP_NODELAY set
* Connected to 1312.gay (86.160.55.49) port 443 (#0)
* schannel: SSL/TLS connection with 1312.gay port 443 (step 1/3)
* schannel: checking server certificate revocation
* schannel: sending initial handshake data: sending 179 bytes...
* schannel: sent initial handshake data: sent 179 bytes
* schannel: SSL/TLS connection with 1312.gay port 443 (step 2/3)
* schannel: failed to receive handshake, need more data
* schannel: SSL/TLS connection with 1312.gay port 443 (step 2/3)
* schannel: encrypted data got 690
* schannel: encrypted data buffer: offset 690 length 4096
* schannel: next InitializeSecurityContext failed: SEC_E_UNTRUSTED_ROOT (0x80090325) - The certificate chain was issued by an authority that is not trusted.
* Closing connection 0
* schannel: shutting down SSL/TLS connection with 1312.gay port 443
* schannel: clear security context handle
curl: (77) schannel: next InitializeSecurityContext failed: SEC_E_UNTRUSTED_ROOT (0x80090325) - The certificate chain was issued by an authority that is not trusted.

4. Error messages and/or full log output:

full CMD output after running caddy from start to finish (with CTRL-C to stop it)

caddy run
2021/05/25 22:04:43.636 ←[34mINFO←[0m   using adjacent Caddyfile
2021/05/25 22:04:43.645 ←[34mINFO←[0m   admin   admin endpoint started  {"address": "tcp/localhost:2019", "enforce_origin": false, "origins": ["localhost:2019", "[::1]:2019", "127.0.0.1:2019"]}
2021/05/25 22:04:43.646 ←[34mINFO←[0m   tls.cache.maintenance   started background certificate maintenance      {"cache": "0xc000342700"}
2021/05/25 22:04:43.647 ←[34mINFO←[0m   http    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}
2021/05/25 22:04:43.648 ←[34mINFO←[0m   http    enabling automatic HTTP->HTTPS redirects        {"server_name": "srv0"}
2021/05/25 22:04:43.650 ←[34mINFO←[0m   http    enabling automatic TLS certificate management   {"domains": ["1312.gay"]}
2021/05/25 22:04:43.666 ←[34mINFO←[0m   tls     cleaning storage unit   {"description": "FileStorage:C:\\Users\\maya\\AppData\\Roaming\\Caddy"}
2021/05/25 22:04:43.667 ←[34mINFO←[0m   autosaved config (load with --resume flag)      {"file": "C:\\Users\\maya\\AppData\\Roaming\\Caddy\\autosave.json"}
2021/05/25 22:04:43.667 ←[34mINFO←[0m   serving initial configuration
2021/05/25 22:04:43.669 ←[34mINFO←[0m   tls     finished cleaning storage units
2021/05/25 22:12:07.063 ←[34mINFO←[0m   shutting down   {"signal": "SIGINT"}
2021/05/25 22:12:07.063 ←[33mWARN←[0m   exiting; byeee!! 👋     {"signal": "SIGINT"}
2021/05/25 22:12:07.095 ←[34mINFO←[0m   tls.cache.maintenance   stopped background certificate maintenance      {"cache": "0xc000342700"}
2021/05/25 22:12:07.110 ←[34mINFO←[0m   admin   stopped previous server {"address": "tcp/localhost:2019"}
2021/05/25 22:12:07.110 ←[34mINFO←[0m   shutdown complete       {"signal": "SIGINT", "exit_code": 0}

5. What I already tried:

i haven’t tried much more than basic research with google, i am very new to this stuff & have no idea where to start.

basic tutorials show a step with email input, which i never saw while setting up Caddy myself.

6. Links to relevant resources:

N/A

Your site is not being served by Caddy, it’s being served by an Apache server.

Make sure your DNS records are correct.

2 Likes

oh thank you so much haha

i didn’t realise i’d have to manually stop the services from apache

the certificate is good now, thank you

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.