-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP implement cert generation script
- Loading branch information
1 parent
987e76e
commit 7bdfccc
Showing
2 changed files
with
11 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
rm *.pem | ||
|
||
# 1. Generate CA's private key and self-signed certificate | ||
openssl req -x509 -newkey rsa:4096 -days 365 -nodes -keyout ca-key.pem -out ca-cert.pem -subj "/C=US/ST=Ohio/L=Dublin/O=Self Sign/OU=Certificate Authority/CN=localhost" | ||
|
||
# 2. Generate web server's private key and certificate signing request (CSR) | ||
openssl req -newkey rsa:4096 -nodes -keyout server-key.pem -out server-req.pem -subj "/C=US/ST=Ohio/L=Dublin/O=Self Sign/OU=Server/CN=localhost" -addext "subjectAltName=DNS:keycloak,DNS:localhost" | ||
|
||
# 3. Use CA's private key to sign web server's CSR and get back the signed certificate | ||
openssl x509 -req -in server-req.pem -days 60 -CA ca-cert.pem -CAkey ca-key.pem -CAcreateserial -out server-cert.pem -copy_extensions copy |