Open brandonros opened 2 years ago
HOSTNAME=$(hostname)
openssl req \
-x509 \
-newkey rsa:4096 \
-sha256 \
-days 3560 \
-nodes \
-keyout $HOSTNAME.key \
-out $HOSTNAME.crt \
-subj "/CN=$HOSTNAME" \
-extensions san \
-config <( \
echo '[req]'; \
echo 'distinguished_name=req'; \
echo '[san]'; \
echo "subjectAltName=DNS.1:localhost,DNS.2:$HOSTNAME")
openssl pkcs12 -export -out $HOSTNAME.pfx \
-inkey $HOSTNAME.key \
-in $HOSTNAME.crt
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain $HOSTNAME.crt
Why not recommend this?
Docker containers can have their own hostname.
Is it just
hostname
output from outside of Docker (host)?