Weird SSL Handshake issue

1. The problem I’m having:

So basically I have caddy setup serving a static site, in my dns records I have both www.aaronrodrigues.com and aaronrodrigues.com pointing to my server. However if I access www.aaronrodrigues.com, I get an SSL HANDSHAKE FAILED error but when I access aaronrodrigues.com I can access my website fine. Not sure whats going on, any help would be appreciated.

2. Error messages and/or full log output:

Unable to get logs since I ran caddy using caddy start

3. Caddy version:

v2.8.4

4. How I installed and ran Caddy:

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

a. System environment:

Ubuntu 22.04 LTS arm64 24GB RAM

b. Command:

sudo caddy start

d. My complete Caddy config:

aaronrodrigues.com {
        root * /var/www/html

        file_server
        
        handle_errors {
                rewrite * /{http.error.status_code}.html
                file_server
        }
}

www.aaronrodrigues.com and aaronrodrigues.com are two different sites. You only defined aaronrodrigues.com in the Caddyfile. If you want to serve www.aaronrodrigues.com as well, you need to add the corresponding configuration to the Caddyfile.

2 Likes