acmesh-official / acme.sh

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

Support forward slash escaping (/ to \/) in JSON responses #4359

Open ch-bach opened 2 years ago

ch-bach commented 2 years ago

acme.sh does currently not support forward slash escaping (/ to \/) in JSON responses. That is why it does not work with the Swiss IT Security AG Product https://www.sits.ch/en/solutions/true-xtender/ .

Steps to reproduce

Fix

I have fixed the acme.sh script as follows: Add the following line after line 1889: _post_url="${_post_url//\\/}"

Add the following line after line 2021 url="${url//\\/}"

Add the following line after line 4510 response="${response//\\/}"

Add the following line after line 4600 response="${response//\\/}"

Update line 6163 to: _authorizations_seg="$(echo "$response" | _egrep_o '"authorizations" *: *\[[^]]*\]' | cut -d '[' -f 2 | tr -d ']' | tr -d '"')"

Could you please update the acme.sh with above fixes in next release?

I have attached a working acme.sh:

acme.sh.txt

github-actions[bot] commented 2 years ago

Please upgrade to the latest code and try again first. Maybe it's already fixed. acme.sh --upgrade If it's still not working, please provide the log with --debug 2, otherwise, nobody can help you.

ch-bach commented 2 years ago

I tried the most current version on CentOS 8.5.2111, it seems that above issues have been fixed. But please check them anyway, especially the line 6163. Thanks