1. The problem I’m having:
I have a running caddy on my network doing reverse proxy to a file server. This works fine. I also have another server running caddy and referencing back to an acme_ca on the other public facing server. This works fine too. Nice to have https on internal web applications.
Now I am trying something apparently more difficult. Trying to get caddy to provide acme_ca https support for my synology web page.
I installed or rather copied a caddy executable to my synolog 218+ running an intel cpu - celeron or pentium. The caddy runs fine there. But when I setup the caddy to work like my other downstream server I found the synology was already using 443 and 80 so i put https_port and http_port setting into caddy to get around this. However whenever I attempt to connect to he webserver using my local dns to resolve the ip address from a url in my local definitions. I get the classic SSL_ERROR_INTERNAL_ERROR_ALERT.
In addition - and this may be the problem. I am seeing caddy errors.
2. Error messages and/or full log output:
2024/02/21 21:53:25.746 INFO tls.issuance.acme.acme_client trying to solve challenge {"identifier": "media01.mooncaptain.pn.net", "challenge_type": "http-01", "ca": "https://acme.localserver/acme/local/directory"}
2024/02/21 21:58:25.870 ERROR tls.issuance.acme.acme_client deactivating authorization {"identifier": "media01.mooncaptain.pn.net", "authz": "https://acme.localserver/acme/local/authz/bjiigAgx0hGtmwrOfCASyWEya7xUFLN3", "error": "attempt 1: https://acme.localserver/acme/local/authz/bjiigAgx0hGtmwrOfCASyWEya7xUFLN3: HTTP 0 urn:ietf:params:acme:error:malformed - The request message was malformed"}
2024/02/21 21:58:25.870 ERROR tls.obtain could not get certificate from issuer {"identifier": "media01.mooncaptain.pn.net", "issuer": "acme.localserver-acme-local-directory", "error": "[media01.mooncaptain.pn.net] solving challenges: [media01.mooncaptain.pn.net] authorization took too long (order=https://acme.localserver/acme/local/order/KVXHGOYg6A0EPXDHZYdD9zAaPFBnqFSB) (ca=https://acme.localserver/acme/local/directory)"}
2024/02/21 21:58:25.870 ERROR tls.obtain will retry {"error": "[media01.mooncaptain.pn.net] Obtain: [media01.mooncaptain.pn.net] solving challenges: [media01.mooncaptain.pn.net] authorization took too long (order=https://acme.localserver/acme/local/order/KVXHGOYg6A0EPXDHZYdD9zAaPFBnqFSB) (ca=https://acme.localserver/acme/local/directory)", "attempt": 6, "retrying_in": 600, "elapsed": 3001.206464712, "max_duration": 2592000}
3. Caddy version:
v2.7.6 h1
4. How I installed and ran Caddy:
I downloaded caddy_linux_amd64 from the caddy website.
I renamed to caddy and parked it in /usr/sbin - to get it into the path
Created a Caddyfile in my home folder.
copied the root.crt from my public facing caddy into /etc/ssl/certs folder.
a. System environment:
Linux Media01 4.4.180+ #42962 SMP Wed Sep 21 10:56:47 CST 2022 x86_64 GNU/Linux synology_apollolake_218+
b. Command:
sudo caddy run
or
sudo caddy start
c. Service/unit/compose file:
no docker no compose no systemd.service
d. My complete Caddy config:
I have three caddy files:
Main caddy - works well
#FRONTEND on fileserver01
# ACME Server
acme.localserver {
acme_server
tls internal
}
https://allthisisthat.net {
reverse_proxy localhost:8080
}
back end that fails
# http://192.168.0.218:8080
# BACKEND - on synology Media01
# Global Option Block
{
# General Option
#debug
# TLS Options
# reference acme server on fileserver01
acme_ca https://acme.localserver/acme/local/directory
# copied from root.crt on fileserver to here:
acme_ca_root /etc/ssl/certs/root.crt
http_port 880
https_port 8443
}
https://media01.mooncaptain.pn.net:8443 {
handle * {
reverse_proxy 192.168.0.218:5000
}
}
Back end that works.
#BACKEND - on mediaserver03
# Global Option Block
{
# General Option
#debug
# TLS Options
# reference acme server on fileserver01
acme_ca https://acme.localserver/acme/local/directory
# copy of root.crt from the fileserver
acme_ca_root /etc/ssl/certs/root.crt
}
https://mediaserver03.mooncaptain.pn.net {
handle /sonarr* {
reverse_proxy localhost:8989
}
handle /emby* {
reverse_proxy localhost:8096
}
handle /nzbget* {
reverse_proxy localhost:6789
}
}
5. Links to relevant resources:
where I got started(Use Caddy for local HTTPS (TLS) between front-end reverse proxy and LAN hosts)