Skip to content

Commit

Permalink
Merge pull request #3733 from acmesh-official/dev
Browse files Browse the repository at this point in the history
sync
  • Loading branch information
Neilpang authored Oct 3, 2021
2 parents 5b1e849 + 84fe665 commit ae25931
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Set ENV
shell: cmd
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
shell: cmd
run: |
Expand Down
24 changes: 23 additions & 1 deletion acme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4934,7 +4934,9 @@ $_authorizations_map"

echo "$response" >"$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 [ "$DEBUG" ]; then
_debug "default chain issuers: " "$(_get_chain_issuers "$CERT_FULLCHAIN_PATH")"
Expand Down Expand Up @@ -6547,6 +6549,8 @@ Commands:
--deactivate Deactivate the domain authz, professional use.
--set-default-ca Used with '--server', Set the default CA to use.
See: $_SERVER_WIKI
--set-default-chain Set the default preferred chain for a CA.
See: $_PREFERRED_CHAIN_WIKI
Parameters:
Expand Down Expand Up @@ -6833,6 +6837,18 @@ setdefaultca() {
_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() {
_CMD=""
_domain=""
Expand Down Expand Up @@ -6984,6 +7000,9 @@ _process() {
--set-default-ca)
_CMD="setdefaultca"
;;
--set-default-chain)
_CMD="setdefaultchain"
;;
-d | --domain)
_dvalue="$2"

Expand Down Expand Up @@ -7514,6 +7533,9 @@ _process() {
setdefaultca)
setdefaultca
;;
setdefaultchain)
setdefaultchain "$_preferred_chain"
;;
*)
if [ "$_CMD" ]; then
_err "Invalid command: $_CMD"
Expand Down

0 comments on commit ae25931

Please sign in to comment.