Skip to content

Instantly share code, notes, and snippets.

@robincher
Created August 29, 2019 09:39
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 robincher/1ec831399160a2a5b3b01c5ce49c597e to your computer and use it in GitHub Desktop.
Save robincher/1ec831399160a2a5b3b01c5ce49c597e to your computer and use it in GitHub Desktop.
Self-Signed CA and Client Certificate
#!/bin/bash
#Generate Self-signed CA
openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout ca.key -out ca.crt
#Make a directory
mkdir client
#Generate Corresponding client certificate
openssl genrsa -out client/helios.key 2048
openssl req -new -key client/helios.key -out client/helios.csr
openssl x509 -req -days 365 -sha256 -in client/helios.csr -CA ca.crt -CAkey ca.key -set_serial 2 -out client/helios.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment