1. The problem I’m having:
Hello,
I am using Caddy with NextCloud aio. NextCloud span different docker containers, some are using Caddy.
One of them is demanding automatically ssl certificates and doing a challenge for it. Looking at the logs of the container, I discovered some weird logs :
I first thought that my server was compromised, but the maintainer of nextcloud AIO
seems to think that it can happens by being triggered from outside, without being compromised - without giving more explanations.
From my understanding, the parameters of which tls challenges are made, and how they are made is using a CaddyFile, so I do not know how this could happens without being compromised. I need to understand what happened to see if the server is - or not compromised, and am looking for scenarios/explanations which could lead to such logs.
I didn’t find any config file in the docker container that would be used by Caddy to produce such results.
2. Error messages and/or full log output:
{"level":"error","ts":1719169925.689722,"logger":"http.acme_client","msg":"challenge failed","identifier":"cf.xijingping.gay","challenge_type":"http-01","problem":{"type":"urn:ietf:params:acme:error:connection","title":"","detail":"2607:f8b0:400f:803::200e: Fetching https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be: received disallowed redirect status code","instance":"","subproblems":[]}}
{"level":"error","ts":1719169925.6898139,"logger":"http.acme_client","msg":"validating authorization","identifier":"cf.xijingping.gay","problem":{"type":"urn:ietf:params:acme:error:connection","title":"","detail":"2607:f8b0:400f:803::200e: Fetching https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be: received disallowed redirect status code","instance":"","subproblems":[]},"order":"https://acme-v02.api.letsencrypt.org/acme/order/1682207537/281049282167","attempt":1,"max_attempts":3}
{"level":"error","ts":1719169925.6898699,"logger":"tls.obtain","msg":"could not get certificate from issuer","identifier":"cf.xijingping.gay","issuer":"acme-v02.api.letsencrypt.org-directory","error":"HTTP 400 urn:ietf:params:acme:error:connection - 2607:f8b0:400f:803::200e: Fetching https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be: received disallowed redirect status code"}
{"level":"error","ts":1719169925.689932,"logger":"tls.obtain","msg":"will retry","error":"[cf.xijingping.gay] Obtain: [cf.xijingping.gay] solving challenge: cf.xijingping.gay: [cf.xijingping.gay] authorization failed: HTTP 400 urn:ietf:params:acme:error:connection - 2607:f8b0:400f:803::200e: Fetching https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be: received disallowed redirect status code (ca=https://acme-v02.api.letsencrypt.org/directory)","attempt":1,"retrying_in":60,"elapsed":1.866532842,"max_duration":2592000}
{"level":"error","ts":1719169987.534045,"logger":"http.acme_client","msg":"challenge failed","identifier":"cf.xijingping.gay","challenge_type":"http-01","problem":{"type":"urn:ietf:params:acme:error:connection","title":"","detail":"2607:f8b0:400a:80a::200e: Fetching https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be: received disallowed redirect status code","instance":"","subproblems":[]}}
{"level":"error","ts":1719169987.5341198,"logger":"http.acme_client","msg":"validating authorization","identifier":"cf.xijingping.gay","problem":{"type":"urn:ietf:params:acme:error:connection","title":"","detail":"2607:f8b0:400a:80a::200e: Fetching https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be: received disallowed redirect status code","instance":"","subproblems":[]},"order":"https://acme-staging-v02.api.letsencrypt.org/acme/order/145270514/17382224113","attempt":1,"max_attempts":3}
{"level":"error","ts":1719169987.5342908,"logger":"tls.obtain","msg":"could not get certificate from issuer","identifier":"cf.xijingping.gay","issuer":"acme-v02.api.letsencrypt.org-directory","error":"HTTP 400 urn:ietf:params:acme:error:connection - 2607:f8b0:400a:80a::200e: Fetching https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be: received disallowed redirect status code"}
{"level":"error","ts":1719169987.5343559,"logger":"tls.obtain","msg":"will retry","error":"[cf.xijingping.gay] Obtain: [cf.xijingping.gay] solving challenge: cf.xijingping.gay: [cf.xijingping.gay] authorization failed: HTTP 400 urn:ietf:params:acme:error:connection - 2607:f8b0:400a:80a::200e: Fetching https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be: received disallowed redirect status code (ca=https://acme-staging-v02.api.letsencrypt.org/directory)","attempt":2,"retrying_in":120,"elapsed":63.710956695,"max_duration":2592000}
{"level":"error","ts":1719174433.8767147,"logger":"http.acme_client","msg":"challenge failed","identifier":"cf.xijingping.gay","challenge_type":"http-01","problem":{"type":"urn:ietf:params:acme:error:connection","title":"","detail":"2607:f8b0:400a:807::200e: Fetching https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be: received disallowed redirect status code","instance":"","subproblems":[]}}
{"level":"error","ts":1719174433.876824,"logger":"http.acme_client","msg":"validating authorization","identifier":"cf.xijingping.gay","problem":{"type":"urn:ietf:params:acme:error:connection","title":"","detail":"2607:f8b0:400a:807::200e: Fetching https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be: received disallowed redirect status code","instance":"","subproblems":[]},"order":"https://acme-v02.api.letsencrypt.org/acme/order/1682207537/281063204897","attempt":1,"max_attempts":3}
{"level":"error","ts":1719174433.8769455,"logger":"tls.obtain","msg":"could not get certificate from issuer","identifier":"cf.xijingping.gay","issuer":"acme-v02.api.letsencrypt.org-directory","error":"HTTP 400 urn:ietf:params:acme:error:connection - 2607:f8b0:400a:807::200e: Fetching https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be: received disallowed redirect status code"}
{"level":"error","ts":1719174433.8770165,"logger":"tls.obtain","msg":"will retry","error":"[cf.xijingping.gay] Obtain: [cf.xijingping.gay] solving challenge: cf.xijingping.gay: [cf.xijingping.gay] authorization failed: HTTP 400 urn:ietf:params:acme:error:connection - 2607:f8b0:400a:807::200e: Fetching https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be: received disallowed redirect status code (ca=https://acme-v02.api.letsencrypt.org/directory)","attempt":1,"retrying_in":60,"elapsed":1.384294412,"max_duration":2592000}
{"level":"error","ts":1719174495.2034523,"logger":"http.acme_client","msg":"challenge failed","identifier":"cf.xijingping.gay","challenge_type":"http-01","problem":{"type":"urn:ietf:params:acme:error:connection","title":"","detail":"2607:f8b0:400a:807::200e: Fetching https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be: received disallowed redirect status code","instance":"","subproblems":[]}}
{"level":"error","ts":1719174495.2035277,"logger":"http.acme_client","msg":"validating authorization","identifier":"cf.xijingping.gay","problem":{"type":"urn:ietf:params:acme:error:connection","title":"","detail":"2607:f8b0:400a:807::200e: Fetching https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be: received disallowed redirect status code","instance":"","subproblems":[]},"order":"https://acme-staging-v02.api.letsencrypt.org/acme/order/145270514/17383111413","attempt":1,"max_attempts":3}
{"level":"error","ts":1719174495.2035854,"logger":"tls.obtain","msg":"could not get certificate from issuer","identifier":"cf.xijingping.gay","issuer":"acme-v02.api.letsencrypt.org-directory","error":"HTTP 400 urn:ietf:params:acme:error:connection - 2607:f8b0:400a:807::200e: Fetching https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be: received disallowed redirect status code"}
{"level":"error","ts":1719174495.2036767,"logger":"tls.obtain","msg":"will retry","error":"[cf.xijingping.gay] Obtain: [cf.xijingping.gay] solving challenge: cf.xijingping.gay: [cf.xijingping.gay] authorization failed: HTTP 400 urn:ietf:params:acme:error:connection - 2607:f8b0:400a:807::200e: Fetching https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be: received disallowed redirect status code (ca=https://acme-staging-v02.api.letsencrypt.org/directory)","attempt":2,"retrying_in":120,"elapsed":62.71093021,"max_duration":2592000}
.
3. Caddy version:
v2.7.6 h1:w0NymbG2m9PcvKWsrXO6EEkY9Ru4FJK8uQbYcev1p3A=
4. How I installed and ran Caddy:
a. System environment:
nextcloud/all-in-one:20240404_082330-latest docker image
b. Command:
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
c. Service/unit/compose file:
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
d. My complete Caddy config:
{
# auto_https will create redirects for https://{host}:8443 instead of https://{host}
# https redirects are added manually in the http://:80 block
auto_https disable_redirects
storage file_system {
root /mnt/docker-aio-config/caddy/
}
log {
level ERROR
}
servers {
protocols h1 h2 h2c
}
on_demand_tls {
ask http://localhost:9876/
}
}
http://:80 {
redir https://{host}{uri} permanent
}
https://:8443 {
reverse_proxy localhost:8000
tls {
on_demand
issuer acme {
disable_tlsalpn_challenge
}
}
}
5. Links to relevant resources:
Link to Nextcloud AIO : GitHub - nextcloud/all-in-one: 📦 The official Nextcloud installation method. Provides easy deployment and maintenance with most features included in this one Nextcloud instance.