-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tls: Add PEM file update script and config
Documentation so we can avoid researching this in the future. The new PEM files have 3560 day expirations.
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[v3_ca] | ||
keyUsage = critical, digitalSignature, keyEncipherment | ||
extendedKeyUsage = serverAuth, clientAuth | ||
basicConstraints = critical, CA:FALSE | ||
subjectKeyIdentifier = hash | ||
authorityKeyIdentifier = keyid,issuer | ||
subjectAltName = IP:127.0.0.1, DNS: localhost, DNS: *.example.com |
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,42 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
openssl genrsa \ | ||
-out ca-key.pem 2048 | ||
|
||
openssl req \ | ||
-x509 \ | ||
-new \ | ||
-nodes \ | ||
-key ca-key.pem \ | ||
-days 3560 \ | ||
-extensions v3_ca \ | ||
-out ca.pem \ | ||
-subj "/O=Kubernetes" | ||
|
||
openssl x509 -in ca.pem -text | ||
|
||
openssl genrsa \ | ||
-out key.pem 2048 | ||
|
||
openssl req \ | ||
-new \ | ||
-key key.pem \ | ||
-out csr.pem \ | ||
-subj "/O=Kubernetes/CN=*.example.com" | ||
|
||
openssl x509 \ | ||
-req \ | ||
-in csr.pem \ | ||
-CA ca.pem \ | ||
-CAkey ca-key.pem \ | ||
-CAcreateserial \ | ||
-out cert.pem \ | ||
-extensions v3_ca \ | ||
-extfile ssl-extensions-x509.cnf \ | ||
-days 3560 | ||
|
||
openssl x509 -in cert.pem -text | ||
|
||
rm ca.srl | ||
rm csr.pem |