Last active
March 5, 2021 21:48
-
-
Save percybolmer/9a6b1adb3ea54783ee73d2441e42d870 to your computer and use it in GitHub Desktop.
Certificate generation script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# generate ca.key | |
openssl genrsa -out ca.key 4096 | |
# generate certificate | |
openssl req -new -x509 -key ca.key -sha256 -subj "/C=SE/ST=HL/O=Example, INC." -days 365 -out ca.cert | |
# generate the server key | |
openssl genrsa -out server.key 4096 | |
# Generate the csr | |
openssl req -new -key server.key -out server.csr -config certificate.conf | |
# | |
openssl x509 -req -in server.csr -CA ca.cert -CAkey ca.key -CAcreateserial -out server.crt -days 365 -sha256 -extfile certificate.conf -extensions req_ext |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment