Skip to content

Commit 9e51432

Browse files
authored
Merge pull request #6745 from acmesh-official/dev
sync
2 parents 1bd2922 + 903a539 commit 9e51432

File tree

13 files changed

+582
-23
lines changed

13 files changed

+582
-23
lines changed

.github/workflows/DNS.yml

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,11 @@ jobs:
251251
fi
252252
cd ../acmetest
253253
./letest.sh
254-
254+
- name: onError
255+
if: ${{ failure() }}
256+
run: |
257+
echo "See how to debug in VM:"
258+
echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM"
255259
256260
257261
@@ -302,7 +306,11 @@ jobs:
302306
fi
303307
cd ../acmetest
304308
./letest.sh
305-
309+
- name: onError
310+
if: ${{ failure() }}
311+
run: |
312+
echo "See how to debug in VM:"
313+
echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM"
306314
307315
308316
@@ -354,7 +362,11 @@ jobs:
354362
fi
355363
cd ../acmetest
356364
./letest.sh
357-
365+
- name: onError
366+
if: ${{ failure() }}
367+
run: |
368+
echo "See how to debug in VM:"
369+
echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM"
358370
359371
360372
@@ -406,7 +418,11 @@ jobs:
406418
fi
407419
cd ../acmetest
408420
./letest.sh
409-
421+
- name: onError
422+
if: ${{ failure() }}
423+
run: |
424+
echo "See how to debug in VM:"
425+
echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM"
410426
411427
412428
@@ -464,6 +480,11 @@ jobs:
464480
fi
465481
cd ../acmetest
466482
./letest.sh
483+
- name: onError
484+
if: ${{ failure() }}
485+
run: |
486+
echo "See how to debug in VM:"
487+
echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM"
467488
468489
469490
Omnios:
@@ -513,6 +534,12 @@ jobs:
513534
fi
514535
cd ../acmetest
515536
./letest.sh
537+
- name: onError
538+
if: ${{ failure() }}
539+
run: |
540+
echo "See how to debug in VM:"
541+
echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM"
542+
516543
517544
518545
OpenIndiana:
@@ -539,7 +566,7 @@ jobs:
539566
- uses: actions/checkout@v4
540567
- name: Clone acmetest
541568
run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
542-
- uses: vmactions/openindiana-vm@v0
569+
- uses: vmactions/openindiana-vm@v1
543570
with:
544571
envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy HTTPS_INSECURE TokenName1 TokenName2 TokenName3 TokenName4 TokenName5 ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}'
545572
sync: nfs
@@ -562,5 +589,12 @@ jobs:
562589
fi
563590
cd ../acmetest
564591
./letest.sh
592+
- name: onError
593+
if: ${{ failure() }}
594+
run: |
595+
echo "See how to debug in VM:"
596+
echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM"
597+
565598
599+
566600

.github/workflows/DragonFlyBSD.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,9 @@ jobs:
6767
run: |
6868
cd ../acmetest \
6969
&& ./letest.sh
70-
70+
- name: onError
71+
if: ${{ failure() }}
72+
run: |
73+
echo "See how to debug in VM:"
74+
echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM"
7175

.github/workflows/FreeBSD.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,9 @@ jobs:
7272
run: |
7373
cd ../acmetest \
7474
&& ./letest.sh
75-
75+
- name: onError
76+
if: ${{ failure() }}
77+
run: |
78+
echo "See how to debug in VM:"
79+
echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM"
7680

.github/workflows/NetBSD.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,9 @@ jobs:
6767
run: |
6868
cd ../acmetest \
6969
&& ./letest.sh
70-
71-
70+
- name: onError
71+
if: ${{ failure() }}
72+
run: |
73+
echo "See how to debug in VM:"
74+
echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM"
75+

.github/workflows/Omnios.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,9 @@ jobs:
7171
run: |
7272
cd ../acmetest \
7373
&& ./letest.sh
74-
74+
- name: onError
75+
if: ${{ failure() }}
76+
run: |
77+
echo "See how to debug in VM:"
78+
echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM"
7579

.github/workflows/OpenBSD.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,9 @@ jobs:
7272
run: |
7373
cd ../acmetest \
7474
&& ./letest.sh
75-
75+
- name: onError
76+
if: ${{ failure() }}
77+
run: |
78+
echo "See how to debug in VM:"
79+
echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM"
7680

.github/workflows/OpenIndiana.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
run: echo "TestingDomain=${{steps.tunnel.outputs.server}}" >> $GITHUB_ENV
6262
- name: Clone acmetest
6363
run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
64-
- uses: vmactions/openindiana-vm@v0
64+
- uses: vmactions/openindiana-vm@v1
6565
with:
6666
envs: 'TEST_LOCAL TestingDomain TEST_ACME_Server CA_ECDSA CA CA_EMAIL TEST_PREFERRED_CHAIN ACME_USE_WGET'
6767
nat: |
@@ -71,5 +71,9 @@ jobs:
7171
run: |
7272
cd ../acmetest \
7373
&& ./letest.sh
74-
74+
- name: onError
75+
if: ${{ failure() }}
76+
run: |
77+
echo "See how to debug in VM:"
78+
echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM"
7579

.github/workflows/Solaris.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,9 @@ jobs:
7373
run: |
7474
cd ../acmetest \
7575
&& ./letest.sh
76-
76+
- name: onError
77+
if: ${{ failure() }}
78+
run: |
79+
echo "See how to debug in VM:"
80+
echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM"
7781

acme.sh

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,7 +1466,7 @@ _toPkcs() {
14661466
${ACME_OPENSSL_BIN:-openssl} pkcs12 -export -out "$_cpfx" -inkey "$_ckey" -in "$_ccert" -certfile "$_cca"
14671467
fi
14681468
if [ "$?" = "0" ]; then
1469-
_savedomainconf "Le_PFXPassword" "$pfxPassword"
1469+
_savedomainconf "Le_PFXPassword" "$pfxPassword" "base64"
14701470
fi
14711471

14721472
}
@@ -2783,6 +2783,7 @@ _clearAPI() {
27832783
ACME_REVOKE_CERT=""
27842784
ACME_NEW_NONCE=""
27852785
ACME_AGREEMENT=""
2786+
ACME_RENEWAL_INFO=""
27862787
}
27872788

27882789
#server
@@ -2827,13 +2828,17 @@ _initAPI() {
28272828
ACME_AGREEMENT=$(echo "$response" | _egrep_o 'termsOfService" *: *"[^"]*"' | cut -d '"' -f 3)
28282829
export ACME_AGREEMENT
28292830

2831+
ACME_RENEWAL_INFO=$(echo "$response" | _egrep_o 'renewalInfo" *: *"[^"]*"' | cut -d '"' -f 3)
2832+
export ACME_RENEWAL_INFO
2833+
28302834
_debug "ACME_KEY_CHANGE" "$ACME_KEY_CHANGE"
28312835
_debug "ACME_NEW_AUTHZ" "$ACME_NEW_AUTHZ"
28322836
_debug "ACME_NEW_ORDER" "$ACME_NEW_ORDER"
28332837
_debug "ACME_NEW_ACCOUNT" "$ACME_NEW_ACCOUNT"
28342838
_debug "ACME_REVOKE_CERT" "$ACME_REVOKE_CERT"
28352839
_debug "ACME_AGREEMENT" "$ACME_AGREEMENT"
28362840
_debug "ACME_NEW_NONCE" "$ACME_NEW_NONCE"
2841+
_debug "ACME_RENEWAL_INFO" "$ACME_RENEWAL_INFO"
28372842
if [ "$ACME_NEW_ACCOUNT" ] && [ "$ACME_NEW_ORDER" ]; then
28382843
return 0
28392844
fi
@@ -4465,7 +4470,7 @@ issue() {
44654470
Le_NextRenewTime=$(_readdomainconf Le_NextRenewTime)
44664471
_debug Le_NextRenewTime "$Le_NextRenewTime"
44674472
if [ -z "$FORCE" ] && [ "$Le_NextRenewTime" ] && [ "$(_time)" -lt "$Le_NextRenewTime" ]; then
4468-
_valid_to_saved=$(_readdomainconf Le_Valid_to)
4473+
_valid_to_saved=$(_readdomainconf Le_Valid_To)
44694474
if [ "$_valid_to_saved" ] && ! _startswith "$_valid_to_saved" "+"; then
44704475
_info "The domain is set to be valid to: $_valid_to_saved"
44714476
_info "It cannot be renewed automatically"
@@ -5450,10 +5455,10 @@ $_authorizations_map"
54505455
_savedomainconf "Le_NextRenewTime" "$Le_NextRenewTime"
54515456

54525457
#convert to pkcs12
5458+
Le_PFXPassword="$(_readdomainconf Le_PFXPassword)"
54535459
if [ "$Le_PFXPassword" ]; then
54545460
_toPkcs "$CERT_PFX_PATH" "$CERT_KEY_PATH" "$CERT_PATH" "$CA_CERT_PATH" "$Le_PFXPassword"
54555461
fi
5456-
export CERT_PFX_PATH
54575462

54585463
if [ "$_real_cert$_real_key$_real_ca$_reload_cmd$_real_fullchain" ]; then
54595464
_savedomainconf "Le_RealCertPath" "$_real_cert"
@@ -5563,6 +5568,10 @@ renew() {
55635568
Le_RenewHook="$(_readdomainconf Le_RenewHook)"
55645569
Le_Preferred_Chain="$(_readdomainconf Le_Preferred_Chain)"
55655570
Le_Certificate_Profile="$(_readdomainconf Le_Certificate_Profile)"
5571+
Le_Valid_From="$(_readdomainconf Le_Valid_From)"
5572+
Le_Valid_To="$(_readdomainconf Le_Valid_To)"
5573+
Le_ExtKeyUse="$(_readdomainconf Le_ExtKeyUse)"
5574+
55665575
# When renewing from an old version, the empty Le_Keylength means 2048.
55675576
# Note, do not use DEFAULT_DOMAIN_KEY_LENGTH as that value may change over
55685577
# time but an empty value implies 2048 specifically.
@@ -5744,6 +5753,10 @@ signcsr() {
57445753
_local_addr="${11}"
57455754
_challenge_alias="${12}"
57465755
_preferred_chain="${13}"
5756+
_valid_f="${14}"
5757+
_valid_t="${15}"
5758+
_cert_prof="${16}"
5759+
_en_key_usage="${17}"
57475760

57485761
_csrsubj=$(_readSubjectFromCSR "$_csrfile")
57495762
if [ "$?" != "0" ]; then
@@ -5787,7 +5800,7 @@ signcsr() {
57875800
_info "Copying CSR to: $CSR_PATH"
57885801
cp "$_csrfile" "$CSR_PATH"
57895802

5790-
issue "$_csrW" "$_csrsubj" "$_csrdomainlist" "$_csrkeylength" "$_real_cert" "$_real_key" "$_real_ca" "$_reload_cmd" "$_real_fullchain" "$_pre_hook" "$_post_hook" "$_renew_hook" "$_local_addr" "$_challenge_alias" "$_preferred_chain"
5803+
issue "$_csrW" "$_csrsubj" "$_csrdomainlist" "$_csrkeylength" "$_real_cert" "$_real_key" "$_real_ca" "$_reload_cmd" "$_real_fullchain" "$_pre_hook" "$_post_hook" "$_renew_hook" "$_local_addr" "$_challenge_alias" "$_preferred_chain" "$_valid_f" "$_valid_t" "$_cert_prof" "$_en_key_usage"
57915804

57925805
}
57935806

@@ -5840,7 +5853,8 @@ list() {
58405853
if [ -z "$_domain" ]; then
58415854
printf "%s\n" "Main_Domain${_sep}KeyLength${_sep}SAN_Domains${_sep}Profile${_sep}CA${_sep}Created${_sep}Renew"
58425855
fi
5843-
for di in "${CERT_HOME}"/{*.*,*:*}/; do
5856+
for di in "${CERT_HOME}"/*.* "${CERT_HOME}"/*:*; do
5857+
[ -d "$di" ] || continue
58445858
d=$(basename "$di")
58455859
_debug d "$d"
58465860
(
@@ -6537,6 +6551,36 @@ deactivate() {
65376551
done
65386552
}
65396553

6554+
#cert
6555+
_getAKI() {
6556+
_cert="$1"
6557+
openssl x509 -in "$_cert" -text -noout | grep "X509v3 Authority Key Identifier" -A 1 | _tail_n 1 | tr -d ' :'
6558+
}
6559+
6560+
#cert
6561+
_getSerial() {
6562+
_cert="$1"
6563+
openssl x509 -in "$_cert" -serial -noout | cut -d = -f 2
6564+
}
6565+
6566+
#cert
6567+
_get_ARI() {
6568+
_cert="$1"
6569+
_aki=$(_getAKI "$_cert")
6570+
_ser=$(_getSerial "$_cert")
6571+
_debug2 "_aki" "$_aki"
6572+
_debug2 "_ser" "$_ser"
6573+
6574+
_akiurl="$(echo "$_aki" | _h2b | _base64 | tr -d = | _url_encode)"
6575+
_debug2 "_akiurl" "$_akiurl"
6576+
_serurl="$(echo "$_ser" | _h2b | _base64 | tr -d = | _url_encode)"
6577+
_debug2 "_serurl" "$_serurl"
6578+
6579+
_ARI_URL="$ACME_RENEWAL_INFO/$_akiurl.$_serurl"
6580+
_get "$_ARI_URL"
6581+
6582+
}
6583+
65406584
# Detect profile file if not specified as environment variable
65416585
_detect_profile() {
65426586
if [ -n "$PROFILE" -a -f "$PROFILE" ]; then
@@ -8112,7 +8156,7 @@ _process() {
81128156
deploy "$_domain" "$_deploy_hook" "$_ecc"
81138157
;;
81148158
signcsr)
8115-
signcsr "$_csr" "$_webroot" "$_cert_file" "$_key_file" "$_ca_file" "$_reloadcmd" "$_fullchain_file" "$_pre_hook" "$_post_hook" "$_renew_hook" "$_local_address" "$_challenge_alias" "$_preferred_chain"
8159+
signcsr "$_csr" "$_webroot" "$_cert_file" "$_key_file" "$_ca_file" "$_reloadcmd" "$_fullchain_file" "$_pre_hook" "$_post_hook" "$_renew_hook" "$_local_address" "$_challenge_alias" "$_preferred_chain" "$_valid_from" "$_valid_to" "$_certificate_profile" "$_extended_key_usage"
81168160
;;
81178161
showcsr)
81188162
showcsr "$_csr" "$_domain"

deploy/qiniu.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
# export QINIU_CDN_DOMAIN="cdn.example.com"
99
# If you have more than one domain, just
1010
# export QINIU_CDN_DOMAIN="cdn1.example.com cdn2.example.com"
11+
# Optional: force HTTPS redirect (default: false)
12+
# export QINIU_FORCE_HTTPS="true"
1113

1214
QINIU_API_BASE="https://api.qiniu.com"
1315

@@ -44,6 +46,12 @@ qiniu_deploy() {
4446
QINIU_CDN_DOMAIN="$_cdomain"
4547
fi
4648

49+
if [ -z "$QINIU_FORCE_HTTPS" ]; then
50+
QINIU_FORCE_HTTPS="false"
51+
else
52+
_savedomainconf QINIU_FORCE_HTTPS "$QINIU_FORCE_HTTPS"
53+
fi
54+
4755
## upload certificate
4856
string_fullchain=$(sed 's/$/\\n/' "$_cfullchain" | tr -d '\n')
4957
string_key=$(sed 's/$/\\n/' "$_ckey" | tr -d '\n')
@@ -69,7 +77,7 @@ qiniu_deploy() {
6977
_debug certId "$_certId"
7078

7179
## update domain ssl config
72-
update_body="{\"certid\":$_certId,\"forceHttps\":false}"
80+
update_body="{\"certid\":$_certId,\"forceHttps\":$QINIU_FORCE_HTTPS}"
7381
for domain in $QINIU_CDN_DOMAIN; do
7482
update_path="/domain/$domain/httpsconf"
7583
update_access_token="$(_make_access_token "$update_path")"

0 commit comments

Comments
 (0)