forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: improve https_renew_cert.sh script
To avoid unnecessarily large diffs, only generate a new private key if necessary. Otherwise, reuse the existing private key and only issue a new certificate. Extend the certificate validity from 1 year to 10 years. Show a text representation of the issued certificate upon completion such that the user can verify the validity. Refs: nodejs#42342 Refs: nodejs#37990
- Loading branch information
Showing
3 changed files
with
23 additions
and
20 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 @@ | ||
csr.pem |
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 |
---|---|---|
@@ -1,18 +1,19 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIC9jCCAd6gAwIBAgIJANHflGRpZM1IMA0GCSqGSIb3DQEBCwUAMBQxEjAQBgNV | ||
BAMMCWxvY2FsaG9zdDAeFw0yMTAzMTUwOTEzMjdaFw0yMjAzMTUwOTEzMjdaMBQx | ||
EjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC | ||
ggEBANMt6TLw9gIxucRgZBn8owavEIMAddxMTjkHiR7jGfaBrvvVTB8ymsIizw/Q | ||
KTANmu2r3EOqeR9Ht25KZFKxOKCDMd3aKHht38HInXIF6CQe8c5P0xsVKZAWkell | ||
8ohL05EsFpcrJODIdHfaovODrtX8w1WexqDsUoPQdEk7pISJ2HhmXzpf7QmV00Ux | ||
8J+64v2pTg8/C9VgpSgxE4oXlfJEqdSIAzGDT+VX96GWXTh7QqLjiQ9T96QHUJEn | ||
Bx0Sr4rO9mY2lOQG408QuCLR/ng2J+lYx+03SC8Lq7lrtt4M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jTxC4ItH+eDYn6VjH7TdILwuruWu23gzT | ||
oV+vxNBGCkMCORTRiK1u7KwPleC0J4WrQWLe/XPvTQIDAQABo0swSTALBgNVHQ8E | ||
BAMCBaAwEwYDVR0lBAwwCgYIKwYBBQUHAwEwJQYDVR0RBB4wHIIJMTI3LjAuMC4x | ||
gglsb2NhbGhvc3SHBH8AAAEwDQYJKoZIhvcNAQELBQADggEBAMMW1VNLj+1jZfIU | ||
DtZcR70RgAJ4SyOU4XqhmYOLloRZYFZAbkVN63RT0miiEiBsBDoh0OokT6ZkS7oz | ||
uK1vmM+zBW1GOd12YkbtEXK3ej/xG1sWu/iESqpAcX1k4A9lG+JqGJtyMot9F1an | ||
7ymSqH6QH0pi/jmdHdeo/ED9rjZsHvhJvWv19qN2gG36NIg3sm6U2MwqPHaXaTt9 | ||
AdxtOgfKJLYhZqQtK9Uap8gn2vXoM6lp4/Ut6tXv74Z3ef2MOKE+9x7r2mBwLXin | ||
9Ldn4aYU7+9z3lSexFHzJlyPBf/6Cc3E7Kbg+FHwTTQkKuTnsSxC04+Rp/dP3B41 | ||
30utgNk= | ||
-----END CERTIFICATE----- |
9 changes: 5 additions & 4 deletions
9
test/fixtures/keys/selfsigned-no-keycertsign/https_renew_cert.sh
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#!/bin/bash | ||
openssl genrsa -out rsa.pem 2048 | ||
openssl rsa -in rsa.pem -out key.pem | ||
if [ ! -f key.pem ]; then | ||
openssl genrsa -out key.pem 2048 | ||
fi | ||
openssl req -sha256 -new -key key.pem -out csr.pem -subj "/CN=localhost" | ||
openssl x509 -req -extfile cert.conf -extensions v3_req -days 365 -in csr.pem -signkey key.pem -out cert.pem | ||
|
||
openssl x509 -req -extfile cert.conf -extensions v3_req -days 3650 -in csr.pem -signkey key.pem -out cert.pem | ||
openssl x509 -in cert.pem -noout -text |