Skip to content

Instantly share code, notes, and snippets.

@finwe
Created August 15, 2018 18:14
Show Gist options
  • Save finwe/5563bbc5ef517e8b3a95ddc9fed6419c to your computer and use it in GitHub Desktop.
Save finwe/5563bbc5ef517e8b3a95ddc9fed6419c to your computer and use it in GitHub Desktop.
easy-rsa CA shorthand script
#!/bin/bash
# first initialize easyrsa root keys and certificates:
# easyrsa3/easyrsa init-pki
# easyrsa3/easyrsa build-ca
# USAGE: ./certgen.sh <domainname>
easyrsa gen-req $1
easyrsa3/easyrsa gen-req $1
easyrsa3/easyrsa sign-req server $1
openssl rsa -in /home/finwe/ca/pki/private/$1.key -out /home/finwe/ca/pki/private/$1.nopass.key
echo "ssl_certificate /home/finwe/ca/pki/issued/$1.crt;"
echo "ssl_certificate_key /home/finwe/ca/pki/private/$1.nopass.key;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment