Use US English to format date

DNS Made Easy API checks for an English date header otherwise it create an error.

In deed, we have in logs:
`response='{"error": ["Invalid request date header:  dim., 28 août 2022 09:24:45 UTC"]}'` (my system was in French)

Using local locale makes it work fine.
This commit is contained in:
Nicolas Rosset 2022-08-28 11:35:13 +02:00 committed by GitHub
parent fc1df9f9a5
commit bcef3c6c9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -134,7 +134,7 @@ _me_rest() {
data="$3"
_debug "$ep"
cdate=$(LANG=C date -u +"%a, %d %b %Y %T %Z")
cdate=$(LC_TIME=en_US.utf8; LANG=C date -u +"%a, %d %b %Y %T %Z")
hmac=$(printf "%s" "$cdate" | _hmac sha1 "$(printf "%s" "$ME_Secret" | _hex_dump | tr -d " ")" hex)
export _H1="x-dnsme-apiKey: $ME_Key"