1. The problem I’m having:
Caddy documentation says on_demand_tls
should be as fast and low latency as possible. The server software I’m running called Garage (self hosted S3) supports an admin API through UNIX sockets for on-demand TLS checks. And of course I want my S3 server to be as fast as possible.
I’d like to use on_demand_tls
with the ask
endpoint being pointed at a UNIX socket path, but the on-demand endpoint is at /check
and I’m not sure how to make this work with Caddy. See the Caddy config section for what I tried.
2. Error messages and/or full log output:
2024/07/20 22:06:22.226 ERROR tls failed to get permission for on-demand certificate {"domain": "sharkey.s3.garage.kennel.girlcock.ceo", "error": "checking unix//run/garage/admin.sock/check to determine if certificate for hostname 'sharkey.s3.garage.kennel.girlcock.ceo' should be allowed: Get \"unix//run/garage/admin.sock/check?domain=sharkey.s3.garage.kennel.girlcock.ceo\": unsupported protocol scheme \"\""}
2024/07/20 22:06:23.079 ERROR tls failed to get permission for on-demand certificate {"domain": "sharkey.s3.garage.kennel.girlcock.ceo", "error": "checking unix//run/garage/admin.sock/check to determine if certificate for hostname 'sharkey.s3.garage.kennel.girlcock.ceo' should be allowed: Get \"unix//run/garage/admin.sock/check?domain=sharkey.s3.garage.kennel.girlcock.ceo\": unsupported protocol scheme \"\""}
2024/07/20 22:06:23.405 ERROR tls failed to get permission for on-demand certificate {"domain": "sharkey.s3.garage.kennel.girlcock.ceo", "error": "checking unix//run/garage/admin.sock/check to determine if certificate for hostname 'sharkey.s3.garage.kennel.girlcock.ceo' should be allowed: Get \"unix//run/garage/admin.sock/check?domain=sharkey.s3.garage.kennel.girlcock.ceo\": unsupported protocol scheme \"\""}
2024/07/20 22:06:23.644 ERROR tls failed to get permission for on-demand certificate {"domain": "sharkey.s3.garage.kennel.girlcock.ceo", "error": "checking unix//run/garage/admin.sock/check to determine if certificate for hostname 'sharkey.s3.garage.kennel.girlcock.ceo' should be allowed: Get \"unix//run/garage/admin.sock/check?domain=sharkey.s3.garage.kennel.girlcock.ceo\": unsupported protocol scheme \"\""}
2024/07/20 22:06:24.205 ERROR tls failed to get permission for on-demand certificate {"domain": "attic.s3.garage.kennel.girlcock.ceo", "error": "checking unix//run/garage/admin.sock/check to determine if certificate for hostname 'attic.s3.garage.kennel.girlcock.ceo' should be allowed: Get \"unix//run/garage/admin.sock/check?domain=attic.s3.garage.kennel.girlcock.ceo\": unsupported protocol scheme \"\""}
2024/07/20 22:06:24.524 ERROR tls failed to get permission for on-demand certificate {"domain": "attic.s3.garage.kennel.girlcock.ceo", "error": "checking unix//run/garage/admin.sock/check to determine if certificate for hostname 'attic.s3.garage.kennel.girlcock.ceo' should be allowed: Get \"unix//run/garage/admin.sock/check?domain=attic.s3.garage.kennel.girlcock.ceo\": unsupported protocol scheme \"\""}
2024/07/20 22:06:43.829 INFO admin admin endpoint started {"address": "unix//run/caddy/admin.sock", "enforce_origin": false, "origins": ["", "//127.0.0.1", "//::1"]}
2024/07/20 22:06:43.962 INFO admin stopped previous server {"address": "unix//run/caddy/admin.sock"}
2024/07/20 22:06:46.191 ERROR tls failed to get permission for on-demand certificate {"domain": "attic.s3.garage.kennel.girlcock.ceo", "error": "checking unix//run/garage/admin.sock to determine if certificate for hostname 'attic.s3.garage.kennel.girlcock.ceo' should be allowed: Get \"unix//run/garage/admin.sock?domain=attic.s3.garage.kennel.girlcock.ceo\": unsupported protocol scheme \"\""}
2024/07/20 22:06:47.019 ERROR tls failed to get permission for on-demand certificate {"domain": "attic.s3.garage.kennel.girlcock.ceo", "error": "checking unix//run/garage/admin.sock to determine if certificate for hostname 'attic.s3.garage.kennel.girlcock.ceo' should be allowed: Get \"unix//run/garage/admin.sock?domain=attic.s3.garage.kennel.girlcock.ceo\": unsupported protocol scheme \"\""}
2024/07/20 22:06:47.367 ERROR tls failed to get permission for on-demand certificate {"domain": "attic.s3.garage.kennel.girlcock.ceo", "error": "checking unix//run/garage/admin.sock to determine if certificate for hostname 'attic.s3.garage.kennel.girlcock.ceo' should be allowed: Get \"unix//run/garage/admin.sock?domain=attic.s3.garage.kennel.girlcock.ceo\": unsupported protocol scheme \"\""}
3. Caddy version:
f8861ca16bd475e8519e7dbf5a2b55e81b329874+modified (28 Jun 24 18:15 UTC)
Self-compiled Caddy from main branch with 1 plugin (ListenCaddy)
4. How I installed and ran Caddy:
Compiled Caddy from main
branch, transferred binary to my server, use my own systemd unit
a. System environment:
Arch Linux x86_64, systemd, self-compiled main
branch of Caddy with 1 plugin
b. Command:
Don’t think this is necessary.
d. My complete Caddy config:
Don’t think this is necessary, will just share the relevant parts:
{
# ..
on_demand_tls {
ask unix//run/garage/admin.sock/check
#ask unix//run/garage/admin.sock
interval 2m
burst 5
}
# ..
}
# ..
s3.garage.kennel.girlcock.ceo, *.s3.garage.kennel.girlcock.ceo {
import common
tls {
on_demand
}
reverse_proxy unix//run/garage/s3.sock
}
# ..