Merge branch 'acmesh-official:master' into dns_cpanel

This commit is contained in:
Bjarne Saltbaek 2021-10-03 16:37:55 +02:00 committed by GitHub
commit 83b49b23e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 2 deletions

View File

@ -54,7 +54,7 @@ jobs:
- name: Set ENV - name: Set ENV
shell: cmd shell: cmd
run: | run: |
echo PATH=C:\tools\cygwin\bin;C:\tools\cygwin\usr\bin >> %GITHUB_ENV% echo PATH=C:\tools\cygwin\bin;C:\tools\cygwin\usr\bin;%PATH% >> %GITHUB_ENV%
- name: Check ENV - name: Check ENV
shell: cmd shell: cmd
run: | run: |

24
acme.sh
View File

@ -4934,7 +4934,9 @@ $_authorizations_map"
echo "$response" >"$CERT_PATH" echo "$response" >"$CERT_PATH"
_split_cert_chain "$CERT_PATH" "$CERT_FULLCHAIN_PATH" "$CA_CERT_PATH" _split_cert_chain "$CERT_PATH" "$CERT_FULLCHAIN_PATH" "$CA_CERT_PATH"
if [ -z "$_preferred_chain" ]; then
_preferred_chain=$(_readcaconf DEFAULT_PREFERRED_CHAIN)
fi
if [ "$_preferred_chain" ] && [ -f "$CERT_FULLCHAIN_PATH" ]; then if [ "$_preferred_chain" ] && [ -f "$CERT_FULLCHAIN_PATH" ]; then
if [ "$DEBUG" ]; then if [ "$DEBUG" ]; then
_debug "default chain issuers: " "$(_get_chain_issuers "$CERT_FULLCHAIN_PATH")" _debug "default chain issuers: " "$(_get_chain_issuers "$CERT_FULLCHAIN_PATH")"
@ -6547,6 +6549,8 @@ Commands:
--deactivate Deactivate the domain authz, professional use. --deactivate Deactivate the domain authz, professional use.
--set-default-ca Used with '--server', Set the default CA to use. --set-default-ca Used with '--server', Set the default CA to use.
See: $_SERVER_WIKI See: $_SERVER_WIKI
--set-default-chain Set the default preferred chain for a CA.
See: $_PREFERRED_CHAIN_WIKI
Parameters: Parameters:
@ -6833,6 +6837,18 @@ setdefaultca() {
_info "Changed default CA to: $(__green "$ACME_DIRECTORY")" _info "Changed default CA to: $(__green "$ACME_DIRECTORY")"
} }
#preferred-chain
setdefaultchain() {
_initpath
_preferred_chain="$1"
if [ -z "$_preferred_chain" ]; then
_err "Please give a '--preferred-chain value' value."
return 1
fi
mkdir -p "$CA_DIR"
_savecaconf "DEFAULT_PREFERRED_CHAIN" "$_preferred_chain"
}
_process() { _process() {
_CMD="" _CMD=""
_domain="" _domain=""
@ -6984,6 +7000,9 @@ _process() {
--set-default-ca) --set-default-ca)
_CMD="setdefaultca" _CMD="setdefaultca"
;; ;;
--set-default-chain)
_CMD="setdefaultchain"
;;
-d | --domain) -d | --domain)
_dvalue="$2" _dvalue="$2"
@ -7514,6 +7533,9 @@ _process() {
setdefaultca) setdefaultca)
setdefaultca setdefaultca
;; ;;
setdefaultchain)
setdefaultchain "$_preferred_chain"
;;
*) *)
if [ "$_CMD" ]; then if [ "$_CMD" ]; then
_err "Invalid command: $_CMD" _err "Invalid command: $_CMD"