fix IDN conversion failure for some emoji domains

For example: 🦈🖥.ws
This commit is contained in:
nervuri 2021-06-04 11:25:24 +00:00
parent 77b61c8fc0
commit ccfc936c4a
Signed by: nervuri
GPG Key ID: C4769EEA7BA61672
1 changed files with 2 additions and 2 deletions

View File

@ -67,7 +67,7 @@ while read -r host; do
fi
# Hostname to punycode.
host=$(echo "$host" | idn)
host=$(echo "$host" | idn --allow-unassigned)
# Hostname to lowercase.
host=$(echo "$host" | tr '[:upper:]' '[:lower:]')
@ -117,7 +117,7 @@ while read -r host; do
# If we got a cert back, then the host and port were valid,
# so they are safe to include in a file name.
# Convert from punycode to unicode, if needed.
host_and_port=$(echo "$host_and_port" | idn --idna-to-unicode)
host_and_port=$(echo "$host_and_port" | idn --allow-unassigned --idna-to-unicode)
echo "$cert" > "certs/${host_and_port}.pem"
printf ' - OK'
else