acmesh-official / acme.sh

A pure Unix shell script implementing ACME client protocol
https://acme.sh
GNU General Public License v3.0
39.03k stars 4.94k forks source link

Unsuccesful update of multi domain certificates (verify error:Invalid response) #1766

Open appscaptain opened 6 years ago

appscaptain commented 6 years ago

Hi, Love the script! It helped me get SSL running successfully on my server using a multi domain certificate. Everything worked perfectly until when it expired unfortunately (so the sites are not working anymore). I’m not sure how to make it successfully auto-renew the certificates.

I’m looking to automatically make acme.sh update the files appscaptain.com.ca, appscaptain.com.crt and appscaptain.com.key inside /etc/nginx/auth-acme/appscaptain.com/ and as far as I understand from the docs acme.sh would automatically do that.

Maybe it tried but when I manually run ./acme.sh --issue -d appscaptain.com -d www.appscaptain.com -d www.appscaptain.dk -d appscaptain.dk -d email.appscaptain.com --nginx it gives me: appscaptain.com:Verify error:Invalid response from http://appscaptain.com/.well-known/acme-challenge/krXxOJ42i6K7I6YRTcXf8vuYef_9yThUKCXqTkkGpPo

I’m wondering what I’m getting wrong? Checked similar issues but I can’t see what the issue is.

Steps to reproduce

I’m on Centos 6.9 64 bit with Nginx. Run ./acme.sh --issue -d appscaptain.com -d www.appscaptain.com -d www.appscaptain.dk -d appscaptain.dk -d email.appscaptain.com --nginx

Debug log

P.S. I can share a full debug log if needed, but it is huge, but here’s a partial log:

[Sat Aug  4 02:44:12 EDT 2018] Reload nginx
[Sat Aug  4 02:44:12 EDT 2018] _realConf='/etc/nginx/conf.d/appscaptain.com.conf'
[Sat Aug  4 02:44:14 EDT 2018] url='https://acme-v01.api.letsencrypt.org/acme/challenge/cxTT_iofIqA4zWvHM0BK6R50sRlVPtfxpYkNaRMdWm4/6170202726'
[Sat Aug  4 02:44:14 EDT 2018] payload='{"resource": "challenge", "keyAuthorization": "R3WbFzTboy23-2Jc3wSE6NrkOeUcIT3tjYF282UJuw4.laREEGRdjUg1YXLhD84lZ8nLr7DCNmL9SS2MHgzXqkA"}'
[Sat Aug  4 02:44:14 EDT 2018] POST
[Sat Aug  4 02:44:14 EDT 2018] _post_url='https://acme-v01.api.letsencrypt.org/acme/challenge/cxTT_iofIqA4zWvHM0BK6R50sRlVPtfxpYkNaRMdWm4/6170202726'
[Sat Aug  4 02:44:15 EDT 2018] _CURL='curl -L --silent --dump-header /root/.acme.sh/http.header  -g '
[Sat Aug  4 02:44:15 EDT 2018] _ret='0'
[Sat Aug  4 02:44:15 EDT 2018] code='202'
[Sat Aug  4 02:44:15 EDT 2018] sleep 2 secs to verify
[Sat Aug  4 02:44:18 EDT 2018] checking
[Sat Aug  4 02:44:18 EDT 2018] GET
[Sat Aug  4 02:44:18 EDT 2018] url='https://acme-v01.api.letsencrypt.org/acme/challenge/cxTT_iofIqA4zWvHM0BK6R50sRlVPtfxpYkNaRMdWm4/6170202726'
[Sat Aug  4 02:44:18 EDT 2018] timeout=
[Sat Aug  4 02:44:18 EDT 2018] _CURL='curl -L --silent --dump-header /root/.acme.sh/http.header  -g '
[Sat Aug  4 02:44:18 EDT 2018] ret='0'
[Sat Aug  4 02:44:18 EDT 2018] appscaptain.com:Verify error:Invalid response from http://appscaptain.com/.well-known/acme-challenge/R3WbFzTboy23-2Jc3wSE6NrkOeUcIT3tjYF282UJuw4: 
[Sat Aug  4 02:44:18 EDT 2018] Debug: get token url.
dandv commented 4 years ago

I have the same problem with a wildcard domain. Looks like the .well-known file wasn't found. I ran acme.sh as root.

[Fri May 22 13:30:44 EDT 2020] Check the nginx conf before setting up.
[Fri May 22 13:30:44 EDT 2020] OK, Set up nginx config file
[Fri May 22 13:30:44 EDT 2020] nginx conf is done, let's check it again.
[Fri May 22 13:30:44 EDT 2020] Reload nginx
[Fri May 22 13:30:44 EDT 2020] _realConf='/etc/nginx/sites-enabled/cryptoclimate.io.conf'
[Fri May 22 13:30:46 EDT 2020] url='https://acme-v02.api.letsencrypt.org/acme/chall-v3/4747209364/yOQPzw'
[Fri May 22 13:30:46 EDT 2020] payload='{}'
[Fri May 22 13:30:46 EDT 2020] POST
[Fri May 22 13:30:46 EDT 2020] _post_url='https://acme-v02.api.letsencrypt.org/acme/chall-v3/4747209364/yOQPzw'
[Fri May 22 13:30:46 EDT 2020] _CURL='curl -L --silent --dump-header /root/.acme.sh/http.header  -g '
[Fri May 22 13:30:47 EDT 2020] _ret='0'
[Fri May 22 13:30:47 EDT 2020] code='200'
[Fri May 22 13:30:47 EDT 2020] trigger validation code: 200
[Fri May 22 13:30:47 EDT 2020] sleep 2 secs to verify
[Fri May 22 13:30:49 EDT 2020] checking
[Fri May 22 13:30:49 EDT 2020] url='https://acme-v02.api.letsencrypt.org/acme/chall-v3/4747209364/yOQPzw'
[Fri May 22 13:30:49 EDT 2020] payload
[Fri May 22 13:30:49 EDT 2020] POST
[Fri May 22 13:30:49 EDT 2020] _post_url='https://acme-v02.api.letsencrypt.org/acme/chall-v3/4747209364/yOQPzw'
[Fri May 22 13:30:49 EDT 2020] _CURL='curl -L --silent --dump-header /root/.acme.sh/http.header  -g '
[Fri May 22 13:30:49 EDT 2020] _ret='0'
[Fri May 22 13:30:49 EDT 2020] code='200'
[Fri May 22 13:30:49 EDT 2020] cryptoclimate.io:Verify error:Invalid response from https://cryptoclimate.io/.well-known/acme-challenge/L_t2Z0x7Ijz0lD7UrcHfVkDRSAal_rV_jH7YojIXJH4 [165.227.53.229]: 
[Fri May 22 13:30:49 EDT 2020] Debug: get token url.
[Fri May 22 13:30:49 EDT 2020] GET
[Fri May 22 13:30:49 EDT 2020] url='http://cryptoclimate.io/.well-known/acme-challenge/L_t2Z0x7Ijz0lD7UrcHfVkDRSAal_rV_jH7YojIXJH4'
[Fri May 22 13:30:49 EDT 2020] timeout=1
[Fri May 22 13:30:49 EDT 2020] _CURL='curl -L --silent --dump-header /root/.acme.sh/http.header  -g  --connect-timeout 1'
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
[Fri May 22 13:30:50 EDT 2020] ret='0'
[Fri May 22 13:30:50 EDT 2020] Skip for removelevel:
[Fri May 22 13:30:50 EDT 2020] pid