Basis-Theory / azure-keyvault-emulator

https://basistheory.com
Apache License 2.0
31 stars 3 forks source link

What would <emulator-hostname> be from README? #94

Open brandonros opened 2 years ago

brandonros commented 2 years ago

Docker containers can have their own hostname.

Is it just hostname output from outside of Docker (host)?

brandonros commented 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?