From ccfc936c4aee8d9fda60b4706e2a135db28f6ff6 Mon Sep 17 00:00:00 2001 From: nervuri Date: Fri, 4 Jun 2021 11:25:24 +0000 Subject: [PATCH] fix IDN conversion failure for some emoji domains MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For example: 🦈🖥.ws --- get-certs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/get-certs.sh b/get-certs.sh index 80dd8f8..25280dd 100755 --- a/get-certs.sh +++ b/get-certs.sh @@ -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