Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在不支持date +%N的系统下阿里云报错SignatureNonceUsed的问题 #6246

Open
Jinenze opened this issue Feb 25, 2025 · 2 comments
Open

Comments

@Jinenze
Copy link

Jinenze commented Feb 25, 2025

如题,以下是源码

_ali_nonce() {
  #_head_n 1 </dev/urandom | _digest "sha256" hex | cut -c 1-31
  #Not so good...
  date +"%s%N" | sed 's/%N//g'
}

我使用的openwrt不支持date +%N

root@OpenWrt:~# date +"%s"
1740475004
root@OpenWrt:~# date +"%s%N"
1740475006

也有人之前提到过alpine系统不支持
#1369
这人也碰到相同的问题
#6204

[Thu Jan 16 01:18:36 UTC 2025] url='https://alidns.aliyuncs.com/?Signature=MYqqbqoq60jux%2BvITIw%2BSZtGDl8%3D&AccessKeyId=LT......m&Action=DescribeDomainRecords&DomainName=_acme-challenge.truenas.zt-plaza.com&Format=json&SignatureMethod=HMAC-SHA1&SignatureNonce=1736990316&SignatureVersion=1.0&Timestamp=2025-01-16T01%3A18%3A36Z&Version=2015-01-09'
[Thu Jan 16 01:18:37 UTC 2025] url='https://alidns.aliyuncs.com/?Signature=92qomfRjsr1q52wzfaL8jDTiwuI%3D&AccessKeyId=LT......m&Action=DescribeDomainRecords&DomainName=truenas.zt-plaza.com&Format=json&SignatureMethod=HMAC-SHA1&SignatureNonce=1736990317&SignatureVersion=1.0&Timestamp=2025-01-16T01%3A18%3A37Z&Version=2015-01-09'
[Thu Jan 16 01:18:37 UTC 2025] url='https://alidns.aliyuncs.com/?Signature=yktrAF5edOVROS0kRtaUmtejIr4%3D&AccessKeyId=LT......m&Action=DescribeDomainRecords&DomainName=zt-plaza.com&Format=json&SignatureMethod=HMAC-SHA1&SignatureNonce=1736990317&SignatureVersion=1.0&Timestamp=2025-01-16T01%3A18%3A37Z&Version=2015-01-09'
[Thu Jan 16 01:18:37 UTC 2025] url='https://alidns.aliyuncs.com/?Signature=p4OLh2%2B3%2FBfh7KqpCQjdTb9yD9A%3D&AccessKeyId=LT......m&Action=DescribeDomainRecords&DomainName=com&Format=json&SignatureMethod=HMAC-SHA1&SignatureNonce=1736990317&SignatureVersion=1.0&Timestamp=2025-01-16T01%3A18%3A37Z&Version=2015-01-09'

我直接加了1秒延迟

_ali_nonce() {
  #_head_n 1 </dev/urandom | _digest "sha256" hex | cut -c 1-31
  #Not so good...
  sleep 1s
  date +"%s%N" | sed 's/%N//g'
}

当然,或许直接换成docker容器就行
可以在Readme上提醒一下?我当时被这个问题折磨很久,完全找不到原因

Copy link

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.

@Neilpang
Copy link
Member

不明白

@Jinenze Jinenze changed the title dns_ali.sh _ali_nonce() SignatureNonceUsed 在不支持date +%N的系统下阿里云报错SignatureNonceUsed的问题 Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants