mirror of
https://github.com/w2c/letsencrypt-esxi.git
synced 2026-01-13 14:21:29 -06:00
Keep existing cert while it is still valid
Letsencrypt has some hiccups sometimes during renewals. Instead of instantly replacing a still valid cert with a self-signed, it should be kept, while it hasn't expired
This commit is contained in:
2
renew.sh
2
renew.sh
@@ -98,6 +98,8 @@ if [ -n "$CERT" ] ; then
|
||||
cp -p "$LOCALDIR/$KEY" "$VMWARE_KEY"
|
||||
cp -p "$LOCALDIR/$CRT" "$VMWARE_CRT"
|
||||
log "Success: Obtained and installed a certificate from Let's Encrypt."
|
||||
elif openssl x509 -checkend 86400 -noout -in "$VMWARE_CRT"; then
|
||||
log "Warning: No cert obtained from Let's Encrypt. Keeping the existing one as it is still valid."
|
||||
else
|
||||
log "Error: No cert obtained from Let's Encrypt. Generating a self-signed certificate."
|
||||
/sbin/generate-certificates
|
||||
|
||||
Reference in New Issue
Block a user