Skip to content

Commit

Permalink
use alphanumeric characters for certificate SANs (#395)
Browse files Browse the repository at this point in the history
The old code would not work on macOS, giving errors like
`tls: failed to parse certificate from server: x509: SAN dNSName is malformed`.
  • Loading branch information
larseggert authored Jul 22, 2024
1 parent 601c9fc commit 4980acb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion certs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:]' </dev/urandom | head -c 250)"
done
fi

Expand Down

0 comments on commit 4980acb

Please sign in to comment.