Skip to content

Commit 45cb36f

Browse files
author
neil
committed
1 parent bee01c9 commit 45cb36f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

dnsapi/dns_ali.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,10 @@ _ali_rest() {
9797
}
9898

9999
_ali_nonce() {
100-
#_head_n 1 </dev/urandom | _digest "sha256" hex | cut -c 1-31
101-
#Not so good...
102-
date +"%s%N" | sed 's/%N//g'
100+
if [ "$ACME_OPENSSL_BIN" ]; then
101+
"$ACME_OPENSSL_BIN" rand -hex 16 2>/dev/null && return 0
102+
fi
103+
printf "%s" "$(date +%s)$$$(date +%N)" | _digest sha256 hex | cut -c 1-32
103104
}
104105

105106
_timestamp() {

0 commit comments

Comments
 (0)