From 4980acbfb49bc1f624b075f652ebb6ed30178035 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Mon, 22 Jul 2024 03:08:27 +0300 Subject: [PATCH] use alphanumeric characters for certificate SANs (#395) The old code would not work on macOS, giving errors like `tls: failed to parse certificate from server: x509: SAN dNSName is malformed`. --- certs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/certs.sh b/certs.sh index 721abb5a..174a120a 100755 --- a/certs.sh +++ b/certs.sh @@ -25,7 +25,7 @@ openssl req -x509 -sha256 -nodes -days 10 -key "$CERTDIR"/ca_0.key \ fakedns="" if [ "$CHAINLEN" != "1" ]; then for i in $(seq 1 20); do - fakedns="$fakedns,DNS:$(LC_CTYPE=C tr -dc 0-9A-Za-z < /dev/urandom | head -c 250)" + fakedns="$fakedns,DNS:$(LC_CTYPE=C tr -dc '[:alnum:]'