Skip to content

Commit b96ac02

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 8cac773 commit b96ac02

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
@@ -5454,20 +5454,22 @@ renew() {
54545454
. "$DOMAIN_CONF"
54555455
_debug Le_API "$Le_API"
54565456

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
5457+
if [ -z "$STAGE" ]; then
5458+
case "$Le_API" in
5459+
"$CA_LETSENCRYPT_V2_TEST")
5460+
_info "Switching back to $CA_LETSENCRYPT_V2"
5461+
Le_API="$CA_LETSENCRYPT_V2"
5462+
;;
5463+
"$CA_BUYPASS_TEST")
5464+
_info "Switching back to $CA_BUYPASS"
5465+
Le_API="$CA_BUYPASS"
5466+
;;
5467+
"$CA_GOOGLE_TEST")
5468+
_info "Switching back to $CA_GOOGLE"
5469+
Le_API="$CA_GOOGLE"
5470+
;;
5471+
esac
5472+
fi
54715473

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

0 commit comments

Comments
 (0)