new example scripts to get a root CA

pull/8/head
Jean-Louis Huynen 2019-01-17 12:13:35 +01:00
parent 598ef2e8d8
commit 12956f605b
2 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash
openssl genrsa -out server.key 2048
openssl genrsa -out server.key 4096
openssl req -sha256 -new -key server.key -out server.csr -subj '/CN=localhost'
openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt
openssl x509 -req -in server.csr -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out server.crt -days 500 -sha256
cat server.crt server.key > server.pem

3
server/gen_root.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
openssl genrsa -out rootCA.key 4096
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.crt