Skip to content

Instantly share code, notes, and snippets.

@bobbae
Created March 17, 2021 21:19
Show Gist options
  • Select an option

  • Save bobbae/47cebdbd7cb3606cfe90486e911a6080 to your computer and use it in GitHub Desktop.

Select an option

Save bobbae/47cebdbd7cb3606cfe90486e911a6080 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Generate self signed root CA cert
openssl req -nodes -x509 -newkey rsa:2048 -keyout ca.key -out ca.crt -subj "/C=AU/ST=VIC/L=Melbourne/O=Ranch/OU=root/CN=root/[email protected]"
# Generate server cert to be signed
openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr -subj "/C=AU/ST=VIC/L=Melbourne/O=Ranch/OU=root/CN=localhost/[email protected]"
# Sign the server cert
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment