Browse Source

Did not working dns_regru.sh with utf and punycode

Previous commit bd73823 broke everything: Certificates do not work on utf or punycode domains!

I tried to make both utf and unicode domains work.

Now this
acme.sh --issue --dns dns_regru --dnssleep 2500 -d 'сайт.рф' -d '*.сайт.рф' --debug

and this

acme.sh --issue --dns dns_regru --dnssleep 2500 -d 'xn--80aswg.xn--p1ai.рф' -d '*.xn--80aswg.xn--p1ai.рф' --debug

works perfect.

I need to work punycode domains due to "Error parsing certificate request: x509: SAN dNSName is malformed" in past with utf.
pull/4326/head
Vitaly Kireev 2 years ago
committed by GitHub
parent
commit
09a625946a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 26
      dnsapi/dns_regru.sh

26
dnsapi/dns_regru.sh

@ -91,11 +91,30 @@ _get_root() {
_regru_rest POST "service/get_list" "username=${REGRU_API_Username}&password=${REGRU_API_Password}&output_format=xml&servtype=domain" _regru_rest POST "service/get_list" "username=${REGRU_API_Username}&password=${REGRU_API_Password}&output_format=xml&servtype=domain"
domains_list=$(echo "${response}" | grep dname | sed -r "s/.*dname=\"([^\"]+)\".*/\\1/g") domains_list=$(echo "${response}" | grep dname | sed -r "s/.*dname=\"([^\"]+)\".*/\\1/g")
if [ "$(_idn "${domain}")" != "${domain}" ]; then
_debug "OK! UTF domain!"
for ITEM in ${domains_list}; do for ITEM in ${domains_list}; do
IDN_ITEM=${ITEM}
case "${domain}" in
*${ITEM}*)
_domain=${ITEM}
_debug _domain "${_domain}"
return 0
;;
esac
done
return 1
else
_debug "OK! Idn domain!"
for ITEM in ${domains_list}; do
IDN_ITEM="$(_idn "${ITEM}")"
case "${domain}" in case "${domain}" in
*${IDN_ITEM}*) *${IDN_ITEM}*)
_domain="$(_idn "${ITEM}")"
_domain=${IDN_ITEM}
_debug _domain "${_domain}" _debug _domain "${_domain}"
return 0 return 0
;; ;;
@ -103,6 +122,9 @@ _get_root() {
done done
return 1 return 1
fi
} }
#returns #returns

Loading…
Cancel
Save