My domain is: kevinfries.com
I ran this command: curl -v www.kevinfries.com
It produced this output:
➜ wiki curl -v https://www.kevinfries.com
- Host www.kevinfries.com:443 was resolved.
- IPv6: (none)
- IPv4: 74.50.144.219
- Trying 74.50.144.219:443...
- Connected to www.kevinfries.com (74.50.144.219) port 443
- ALPN: curl offers h2,http/1.1
- (304) (OUT), TLS handshake, Client hello (1):
- CAfile: /etc/ssl/cert.pem
- CApath: none
- LibreSSL/3.3.6: error:1404B438:SSL routines:ST_CONNECT:tlsv1 alert internal error
- Closing connection
curl: (35) LibreSSL/3.3.6: error:1404B438:SSL routines:ST_CONNECT:tlsv1 alert internal error
My web server is (include version): Caddy
The operating system my web server runs on is (include version): macOS - Sonoma
My hosting provider, if applicable, is: None, its on my Mac Mini M1
I can login to a root shell on my machine (yes or no, or I don't know): yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel): no
The version of my client is (e.g. output of certbot --version
or certbot-auto --version
if you're using Certbot): Trying to get it to update via Caddy
——-
OK, I think I am missing a step here and could use some help figuring out where that missed step is.
I have Caddy configured and working just fine, without SSL. Leaving everything on HTTP, and using port 80, I can:
- go to kevinfries.com and it automatically redirects me to www.kevinfries.com
- go to www.kevinfries.com and it displays the shell of a web page to be defined soon
- go to git.kevinfries.com and it shows me my Gita login page
- go to wiki.kevinfries.com and it shows me the Dokuwiki front page
Perfect. Next I change my config to instead of listening on 80, it has my domain name. This is what most of the documentation at Caddy says.
When I do a caddy validate, it says everything is valid. Though the 4th line seems like it is trying to tell me something, but googling is not helping. It then tells me that it started then stopped certificate maintenance. Here is the output:
2024/06/05 23:01:16.051 INFO using adjacent Caddyfile
2024/06/05 23:01:16.051 INFO using config from file {"file": "Caddyfile"}
2024/06/05 23:01:16.052 INFO adapted config to JSON {"adapter": "caddyfile"}
2024/06/05 23:01:16.053 INFO http.auto_https 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}
2024/06/05 23:01:16.053 INFO http.auto_https enabling automatic HTTP->HTTPS redirects {"server_name": "srv0"}
2024/06/05 23:01:16.053 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0x14000693580"}
2024/06/05 23:01:16.054 INFO tls.cache.maintenance stopped background certificate maintenance {"cache": "0x14000693580"}
Valid configuration
So I do a “brew services restart caddy” and I see the following:
Stopping caddy
... (might take a while)
==> Successfully stopped caddy
(label: homebrew.mxcl.caddy)
==> Successfully started caddy
(label: homebrew.mxcl.caddy)
If I do an NMAP on my domain, I see only 22, 80, and 443 open… PERFECT
I tried to hit the site with a web browser to no success. So, I fell back to a good old fashion curl:
➜ wiki curl -v http://www.kevinfries.com
- Host www.kevinfries.com:80 was resolved.
- IPv6: (none)
- IPv4: 74.50.144.219
- Trying 74.50.144.219:80...
- Connected to www.kevinfries.com (74.50.144.219) port 80
GET / HTTP/1.1
Host: www.kevinfries.com
User-Agent: curl/8.6.0
Accept: /
< HTTP/1.1 308 Permanent Redirect
< Connection: close
< Location: https://www.kevinfries.com/
< Server: Caddy
< Date: Wed, 05 Jun 2024 23:22:12 GMT
< Content-Length: 0
<
- Closing connection
➜ wiki curl -v https://www.kevinfries.com - Host www.kevinfries.com:443 was resolved.
- IPv6: (none)
- IPv4: 74.50.144.219
- Trying 74.50.144.219:443...
- Connected to www.kevinfries.com (74.50.144.219) port 443
- ALPN: curl offers h2,http/1.1
- (304) (OUT), TLS handshake, Client hello (1):
- CAfile: /etc/ssl/cert.pem
- CApath: none
- LibreSSL/3.3.6: error:1404B438:SSL routines:ST_CONNECT:tlsv1 alert internal error
- Closing connection
curl: (35) LibreSSL/3.3.6: error:1404B438:SSL routines:ST_CONNECT:tlsv1 alert internal error
Access on http properly does a HTTP-308 redirection to https, then https is not validly handling the handshake. It also looks like it is trying to use my system wide certificates, instead of anything from Let’s Encrypt.
Next I went to Let’s Debug, Tried to see if it could shed some light on things:
HTTP-01 complained that this did not work, and I suspect that this is correct, as it got a 308 redirect.
DNS-01 and TLS-ALPN-01 both said everything was good.
So, I think I am close, very close, but I have missed a step with all this bouncing between the Let’s Encrypt and Caddy websites. I was expecting that I needed to do more on this site, then reference it in my Caddyfile, but can not find simple, straightforward instructions on what that may be.
Anyone else see something like I am seeing, and can shed light on what I missed?