Skip to content

Commit 854e84e

Browse files
Allow renewal of staging certs and honor --staging/--test flags.
It is nice to be able to reliably test cert renewals, such as when a cert is requested in an application using a different method than it is being renewed as, such as when a cert is obtained through standalone mode, and then expected to renew through nginx/apache. Testing renewals by running the cron command swaps out staging cert requests for production ones. Operators may want to test the renewal command and append --force --test of the form: `acme.sh --cron --home="/home/letsencrypt" --force --test` make the --test flag (or --staging) flag on this command honor the request to continue to use staging servers for renewals when requested. related to #6368
1 parent 52e051b commit 854e84e

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

acme.sh

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5453,20 +5453,22 @@ renew() {
54535453
. "$DOMAIN_CONF"
54545454
_debug Le_API "$Le_API"
54555455

5456-
case "$Le_API" in
5457-
"$CA_LETSENCRYPT_V2_TEST")
5458-
_info "Switching back to $CA_LETSENCRYPT_V2"
5459-
Le_API="$CA_LETSENCRYPT_V2"
5460-
;;
5461-
"$CA_BUYPASS_TEST")
5462-
_info "Switching back to $CA_BUYPASS"
5463-
Le_API="$CA_BUYPASS"
5464-
;;
5465-
"$CA_GOOGLE_TEST")
5466-
_info "Switching back to $CA_GOOGLE"
5467-
Le_API="$CA_GOOGLE"
5468-
;;
5469-
esac
5456+
if [ -z "$STAGE" ]; then
5457+
case "$Le_API" in
5458+
"$CA_LETSENCRYPT_V2_TEST")
5459+
_info "Switching back to $CA_LETSENCRYPT_V2"
5460+
Le_API="$CA_LETSENCRYPT_V2"
5461+
;;
5462+
"$CA_BUYPASS_TEST")
5463+
_info "Switching back to $CA_BUYPASS"
5464+
Le_API="$CA_BUYPASS"
5465+
;;
5466+
"$CA_GOOGLE_TEST")
5467+
_info "Switching back to $CA_GOOGLE"
5468+
Le_API="$CA_GOOGLE"
5469+
;;
5470+
esac
5471+
fi
54705472

54715473
if [ "$_server" ]; then
54725474
Le_API="$_server"

0 commit comments

Comments
 (0)