Skip to content

Instantly share code, notes, and snippets.

@amslezak
Last active May 9, 2020 00:31
Show Gist options
  • Save amslezak/9a191a734dbd244a19f669a8bcc4f90a to your computer and use it in GitHub Desktop.
Save amslezak/9a191a734dbd244a19f669a8bcc4f90a to your computer and use it in GitHub Desktop.
tl;dr of https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/configuring-https-ssl.html Used for many generating self-signed certificates for backend services and uploading to AWS ACM
#!/bin/bash
# generate private key to create certificate signing request
# privatekey.pem
openssl genrsa 2048 >private.pem
# create a certificate signing request (CSR)
# csr.pem
openssl req -new -key private.pem -out csr.pem
# sign the certificate (from CSR)
# public.crt
openssl x509 -req -days 9999 -in csr.pem -signkey private.pem -out public.crt
# for windows servers - generate PFX certificate
# public.pfx
openssl pkcs12 -export -out public.pfx -inkey private.pem -in public.crt
# Keep the private key and public certificate for later use.
# Delete the signing request
rm csr.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment