acmesh-official / acme.sh

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

acme.sh does not work on webfolder path including spaces #1843

Open JacobTaylor-RCC opened 6 years ago

JacobTaylor-RCC commented 6 years ago

Steps to reproduce

1: acme.sh --issue -d www.example.com -d example.com -w '/Library/FileMaker\ Server/HTTPServer/htdocs/example.com' --debug 2: curl returns contents of 404 error page because acme.sh is putting challenge in the following wrong path: [snip from debug log] Debugging, skip removing: /Library/FileMaker\/.well-known/acme-challenge/gCuNdkPR01Qm2ltb0Ani8M8RiUY5oDDZGQQdzsvj53M

I have tried the command with single quotes, double quotes, and no quotes. fails exactly the same way every time.

Debug log

relevant snippets:

[Thu Sep 13 16:26:18 PDT 2018] Using config home:/var/root/.acme.sh
https://github.com/Neilpang/acme.sh
v2.8.0
[Thu Sep 13 16:26:18 PDT 2018] _currentRoot='/Library/FileMaker\ Server/HTTPServer/htdocs/example.com'

I have snipped the ends of the following lines for privacy, but they illustrate where it all goes wrong.

[Thu Sep 13 16:26:28 PDT 2018] entry='"type":"http-01","status":"pending","uri":"https://acme-v01.api.letsencrypt.org/acme/challenge/
[Thu Sep 13 16:26:28 PDT 2018] token=''
[Thu Sep 13 16:26:28 PDT 2018] uri='https://acme-v01.api.letsencrypt.org/acme/challenge/
[Thu Sep 13 16:26:28 PDT 2018] keyauthorization='
[Thu Sep 13 16:26:28 PDT 2018] dvlist='example.com#hashcode#LE-ACMEchallengeURL#http-01#/Library/FileMaker\ Server/HTTPServer/htdocs/example.com'
[Thu Sep 13 16:26:28 PDT 2018] d
[Thu Sep 13 16:26:28 PDT 2018] vlist='www.example.com#hashcode#LE-ACMEchallengeURL#http-01#/Library/FileMaker\ Server/HTTPServer/htdocs/example.com,example.com#hashcode#LE-ACMEchallengeURL#http-01#/Library/FileMaker\ Server/HTTPServer/htdocs/example.com,'
[Thu Sep 13 16:26:28 PDT 2018] d='www.example.com'
[Thu Sep 13 16:26:28 PDT 2018] d='Server/HTTPServer/htdocs/example.com'
[Thu Sep 13 16:26:28 PDT 2018] d='example.com'
[Thu Sep 13 16:26:28 PDT 2018] d='Server/HTTPServer/htdocs/example.com'
[Thu Sep 13 16:26:28 PDT 2018] ok, let's start to verify
[Thu Sep 13 16:26:28 PDT 2018] Verifying:www.example.com
[Thu Sep 13 16:26:28 PDT 2018] d='www.example.com'
[Thu Sep 13 16:26:28 PDT 2018] keyauthorization='
[Thu Sep 13 16:26:28 PDT 2018] uri='LE-ACMEchallengeURL
[Thu Sep 13 16:26:28 PDT 2018] _currentRoot='/Library/FileMaker\'
[Thu Sep 13 16:26:28 PDT 2018] wellknown_path='/Library/FileMaker\/.well-known/acme-challenge'
[Thu Sep 13 16:26:28 PDT 2018] writing token:tokencontents to /Library/FileMaker\/.well-known/acme-challenge/stuff

Using single quotes seems to work most of the way through the process -- there are parts of the debug log early on that correctly state the web path, but by the verification section it does not work anymore.

JacobTaylor-RCC commented 6 years ago

Followup note: Platform is OSX 10.13.6 High Sierra (which may matter for the assumptions about the CLI utilities ACME is using).

TheSecMaven commented 3 years ago

I believe I am having the same issue. No workaround I can see.

TheSecMaven commented 3 years ago

I think the issue is how the for loops split on spaces when looping over ventries. We would need to change the delimiter for those loops to fix this.