Skip to content

Instantly share code, notes, and snippets.

@NullArray
Last active August 22, 2018 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NullArray/de1406d4e18790a861574f7cffdbc3d4 to your computer and use it in GitHub Desktop.
Save NullArray/de1406d4e18790a861574f7cffdbc3d4 to your computer and use it in GitHub Desktop.
Small shell script to generate OpenSSL cert.
#!/bin/sh
openssl genrsa -aes256 -out priv.pem 2048
cat priv.pem
openssl rsa -text -in priv.pem
openssl rsa -in priv.pem -pubout -out pub.pem
openssl req -new -key priv.pem -out cert.csr
openssl req -text -in cert.csr -noout
# Set to be renewed after a year.
openssl x509 -req -days 365 -in cert.csr -signkey priv.pem -out cert.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment