mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 21:34:12 -07:00
Fix Let's Encrypt for IDN domains
This commit is contained in:
parent
2da2c539f1
commit
0713570b87
1 changed files with 11 additions and 2 deletions
|
@ -22,6 +22,14 @@ source $VESTA/func/main.sh
|
||||||
source $VESTA/func/domain.sh
|
source $VESTA/func/domain.sh
|
||||||
source $VESTA/conf/vesta.conf
|
source $VESTA/conf/vesta.conf
|
||||||
|
|
||||||
|
# Additional argument formatting
|
||||||
|
format_identifier_idn() {
|
||||||
|
identifier_idn=$identifier
|
||||||
|
if [[ "$identifier_idn" = *[![:ascii:]]* ]]; then
|
||||||
|
identifier_idn=$(idn -t --quiet -a $identifier_idn)
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# encode base64
|
# encode base64
|
||||||
encode_base64() {
|
encode_base64() {
|
||||||
cat |base64 |tr '+/' '-_' |tr -d '\r\n='
|
cat |base64 |tr '+/' '-_' |tr -d '\r\n='
|
||||||
|
@ -109,7 +117,8 @@ fi
|
||||||
url="$API/acme/new-order"
|
url="$API/acme/new-order"
|
||||||
payload='{"identifiers":['
|
payload='{"identifiers":['
|
||||||
for identifier in $(echo $domain,$aliases |tr ',' '\n' |sort -u); do
|
for identifier in $(echo $domain,$aliases |tr ',' '\n' |sort -u); do
|
||||||
payload=$payload'{"type":"dns","value":"'$identifier'"},'
|
format_identifier_idn
|
||||||
|
payload=$payload'{"type":"dns","value":"'$identifier_idn'"},'
|
||||||
done
|
done
|
||||||
payload=$(echo "$payload"|sed "s/,$//")
|
payload=$(echo "$payload"|sed "s/,$//")
|
||||||
payload=$payload']}'
|
payload=$payload']}'
|
||||||
|
@ -209,7 +218,7 @@ done
|
||||||
ssl_dir=$($BIN/v-generate-ssl-cert "$domain" "info@$domain" "US" "California"\
|
ssl_dir=$($BIN/v-generate-ssl-cert "$domain" "info@$domain" "US" "California"\
|
||||||
"San Francisco" "Vesta" "IT" "$aliases" |tail -n1 |awk '{print $2}')
|
"San Francisco" "Vesta" "IT" "$aliases" |tail -n1 |awk '{print $2}')
|
||||||
|
|
||||||
# Sedning CSR to finalize order / STEP 6
|
# Sending CSR to finalize order / STEP 6
|
||||||
csr=$(openssl req -in $ssl_dir/$domain.csr -outform DER |encode_base64)
|
csr=$(openssl req -in $ssl_dir/$domain.csr -outform DER |encode_base64)
|
||||||
payload='{"csr":"'$csr'"}'
|
payload='{"csr":"'$csr'"}'
|
||||||
answer=$(query_le_v2 "$finalize" "$payload" "$nonce")
|
answer=$(query_le_v2 "$finalize" "$payload" "$nonce")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue