Question

SSL caddy with droplet

Created a fresh droplet and decided to test it with caddy to serve with https. Following this awesome article showing how to use caddy inside droplet. Everything went well up until step 4 (Enabling Automatic TLS with Let’s Encrypt).

Basically, when i did all the steps in the step 4. I go to my domain and received ERR_SSL_PROTOCOL_ERROR error.

Caddyfile

<domainname>.com.my {
    root * /var/www
    encode gzip
    file_server

    tls {
      dns digitalocean dop_v1_...
    }
}

/etc/systemd/system/caddy.service

[Service]
Type=notify
User=caddy
Group=caddy
Environment=DO_AUTH_TOKEN=dop_v1_...
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE

status

● caddy.service - Caddy
     Loaded: loaded (/etc/systemd/system/caddy.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2024-06-21 11:20:43 UTC; 23min ago
       Docs: https://caddyserver.com/docs/
   Main PID: 152795 (caddy)
      Tasks: 8 (limit: 2220)
     Memory: 10.8M
        CPU: 439ms
     CGroup: /system.slice/caddy.service
             └─152795 /usr/bin/caddy run --environ --config /etc/caddy/Caddyfile

any idea what might causing this issue?


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

alexdo
Site Moderator
Site Moderator badge
June 27, 2024

Heya, @f4df2e98b9c74f7eb7f6a0629cf1c4

The ERR_SSL_PROTOCOL_ERROR error typically indicates an issue with the SSL/TLS configuration. - he Caddy logs can provide more detailed information about what is going wrong. Check the logs with the following command:

sudo journalctl -u caddy -f

Look for any errors related to SSL/TLS or Let’s Encrypt.

Regards

KFSys
Site Moderator
Site Moderator badge
June 22, 2024

Heya,

Did you add your domain name in the config file? Also are you sure your domain is pointed to your Droplet?

Additinally, can you share your logs?

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.