fix #7155: proxmox-acme: support upper-hex mode of _url_encode
The _url_encode function of acme.sh takes an optional 'upper-hex' argument, which makes it output the percent-encoded characters with upper-case hex digits. Our copy of the function in proxmox-acme lacks it and always outputs lower-case hex. The Aliyun DNS plugin of the bundled acme.sh version uses this argument for the signature of its API requests, as the Aliyun API requires upper-case hex there. So the signature never matched, and adding the TXT record always failed with "SignatureDoesNotMatch". Add the argument the same way acme.sh implements it, as suggested in the bug. Upstream changed the Aliyun plugin in the meantime to not rely on the argument anymore, because of bundled copies like ours, but newer plugins, like dns_baidu.sh and dns_hw.sh, use it too. Signed-off-by: Michal Fox <me@dualfroz.com>
This commit is contained in:
1 parent
d263f38c91
commit
f696e885c0
1 file changed
+5
@@ -510,7 +510,9 @@ _hex_dump() {
|
||||
}
|
||||
|
||||
# stdin stdout
|
||||
#_url_encode [upper-hex] the encoded hex will be upper-case if the argument upper-hex is followed
|
||||
_url_encode() {
|
||||
_upper_hex=$1
|
||||
_hex_str=$(_hex_dump)
|
||||
for _hex_code in $_hex_str; do
|
||||
#upper case
|
||||
@@ -720,6 +722,9 @@ _url_encode() {
|
||||
|
||||
#other hex
|
||||
*)
|
||||
if [ "$_upper_hex" = "upper-hex" ]; then
|
||||
_hex_code=$(printf "%s" "$_hex_code" | _upper_case)
|
||||
fi
|
||||
printf '%%%s' "$_hex_code"
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in new issue
Block a user