Changeset 79f7e49
- Timestamp:
- 01/18/22 12:47:03 (3 years ago)
- Branches:
- master
- Children:
- 39a3656
- Parents:
- 3daa803
- Location:
- npl/syn3/acme
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
npl/syn3/acme/root/usr/bin/acme.sh
r3daa803 r79f7e49 1 1 #!/usr/bin/env sh 2 2 3 VER= 3.0.13 VER=2.8.8 4 4 5 5 PROJECT_NAME="acme.sh" … … 21 21 _SUB_FOLDERS="$_SUB_FOLDER_DNSAPI $_SUB_FOLDER_DEPLOY $_SUB_FOLDER_NOTIFY" 22 22 23 CA_LETSENCRYPT_V1="https://acme-v01.api.letsencrypt.org/directory" 23 LETSENCRYPT_CA_V1="https://acme-v01.api.letsencrypt.org/directory" 24 LETSENCRYPT_STAGING_CA_V1="https://acme-staging.api.letsencrypt.org/directory" 24 25 25 26 CA_LETSENCRYPT_V2="https://acme-v02.api.letsencrypt.org/directory" … … 32 33 _ZERO_EAB_ENDPOINT="http://api.zerossl.com/acme/eab-credentials-email" 33 34 34 CA_SSLCOM_RSA="https://acme.ssl.com/sslcom-dv-rsa" 35 CA_SSLCOM_ECC="https://acme.ssl.com/sslcom-dv-ecc" 36 37 DEFAULT_CA=$CA_ZEROSSL 35 DEFAULT_CA=$CA_LETSENCRYPT_V2 38 36 DEFAULT_STAGING_CA=$CA_LETSENCRYPT_V2_TEST 39 37 40 38 CA_NAMES=" 41 ZeroSSL.com,zerossl42 39 LetsEncrypt.org,letsencrypt 43 40 LetsEncrypt.org_test,letsencrypt_test,letsencrypttest 44 41 BuyPass.com,buypass 45 42 BuyPass.com_test,buypass_test,buypasstest 46 SSL.com,sslcom 43 ZeroSSL.com,zerossl 47 44 " 48 45 49 CA_SERVERS="$CA_ ZEROSSL,$CA_LETSENCRYPT_V2,$CA_LETSENCRYPT_V2_TEST,$CA_BUYPASS,$CA_BUYPASS_TEST,$CA_SSLCOM_RSA"46 CA_SERVERS="$CA_LETSENCRYPT_V2,$CA_LETSENCRYPT_V2_TEST,$CA_BUYPASS,$CA_BUYPASS_TEST,$CA_ZEROSSL" 50 47 51 48 DEFAULT_USER_AGENT="$PROJECT_NAME/$VER ($PROJECT)" … … 106 103 DOH_CLOUDFLARE=1 107 104 DOH_GOOGLE=2 108 DOH_ALI=3109 DOH_DP=4110 105 111 106 HIDDEN_VALUE="[hidden](please add '--output-insecure' to see this value)" … … 162 157 _ZEROSSL_WIKI="https://github.com/acmesh-official/acme.sh/wiki/ZeroSSL.com-CA" 163 158 164 _SSLCOM_WIKI="https://github.com/acmesh-official/acme.sh/wiki/SSL.com-CA"165 166 159 _SERVER_WIKI="https://github.com/acmesh-official/acme.sh/wiki/Server" 167 160 168 161 _PREFERRED_CHAIN_WIKI="https://github.com/acmesh-official/acme.sh/wiki/Preferred-Chain" 169 170 _DNSCHECK_WIKI="https://github.com/acmesh-official/acme.sh/wiki/dnscheck"171 162 172 163 _DNS_MANUAL_ERR="The dns manual mode can not renew automatically, you must issue it again manually. You'd better use the other modes instead." … … 570 561 571 562 _h2b() { 572 if _exists xxd; then 573 if _contains "$(xxd --help 2>&1)" "assumes -c30"; then 574 if xxd -r -p -c 9999 2>/dev/null; then 575 return 576 fi 577 else 578 if xxd -r -p 2>/dev/null; then 579 return 580 fi 581 fi 563 if _exists xxd && xxd -r -p 2>/dev/null; then 564 return 582 565 fi 583 566 … … 1140 1123 if _isEccKey "$length"; then 1141 1124 _debug "Using ec name: $eccname" 1142 if _opkey="$(${ACME_OPENSSL_BIN:-openssl} ecparam -name "$eccname" - noout -genkey 2>/dev/null)"; then1125 if _opkey="$(${ACME_OPENSSL_BIN:-openssl} ecparam -name "$eccname" -genkey 2>/dev/null)"; then 1143 1126 echo "$_opkey" >"$f" 1144 1127 else … … 1148 1131 else 1149 1132 _debug "Using RSA: $length" 1150 __traditional="" 1151 if _contains "$(${ACME_OPENSSL_BIN:-openssl} help genrsa 2>&1)" "-traditional"; then 1152 __traditional="-traditional" 1153 fi 1154 if _opkey="$(${ACME_OPENSSL_BIN:-openssl} genrsa $__traditional "$length" 2>/dev/null)"; then 1133 if _opkey="$(${ACME_OPENSSL_BIN:-openssl} genrsa "$length" 2>/dev/null)"; then 1155 1134 echo "$_opkey" >"$f" 1156 1135 else … … 1219 1198 _debug2 csrconf "$csrconf" 1220 1199 1221 printf "[ req_distinguished_name ]\n[ req ]\ndistinguished_name = req_distinguished_name\nreq_extensions = v3_req\n[ v3_req ]\n\n " >"$csrconf"1200 printf "[ req_distinguished_name ]\n[ req ]\ndistinguished_name = req_distinguished_name\nreq_extensions = v3_req\n[ v3_req ]\n\nkeyUsage = nonRepudiation, digitalSignature, keyEncipherment" >"$csrconf" 1222 1201 1223 1202 if [ "$acmeValidationv1" ]; then … … 1771 1750 _ACME_CURL="$_ACME_CURL -L " 1772 1751 fi 1773 if [ "$DEBUG" ] && [ "$DEBUG" -ge 2]; then1752 if [ "$DEBUG" ] && [ "$DEBUG" -ge "2" ]; then 1774 1753 _CURL_DUMP="$(_mktemp)" 1775 1754 _ACME_CURL="$_ACME_CURL --trace-ascii $_CURL_DUMP " … … 1810 1789 1811 1790 } 1812 1813 _HTTP_MAX_RETRY=81814 1791 1815 1792 # body url [needbase64] [POST|PUT|DELETE] [ContentType] … … 1820 1797 httpmethod="$4" 1821 1798 _postContentType="$5" 1822 _sleep_retry_sec=11823 _http_retry_times=01824 _hcode=01825 while [ "${_http_retry_times}" -le "$_HTTP_MAX_RETRY" ]; do1826 [ "$_http_retry_times" = "$_HTTP_MAX_RETRY" ]1827 _lastHCode="$?"1828 _debug "Retrying post"1829 _post_impl "$body" "$_post_url" "$needbase64" "$httpmethod" "$_postContentType" "$_lastHCode"1830 _hcode="$?"1831 _debug _hcode "$_hcode"1832 if [ "$_hcode" = "0" ]; then1833 break1834 fi1835 _http_retry_times=$(_math $_http_retry_times + 1)1836 _sleep $_sleep_retry_sec1837 done1838 return $_hcode1839 }1840 1841 # body url [needbase64] [POST|PUT|DELETE] [ContentType] [displayError]1842 _post_impl() {1843 body="$1"1844 _post_url="$2"1845 needbase64="$3"1846 httpmethod="$4"1847 _postContentType="$5"1848 displayError="$6"1849 1799 1850 1800 if [ -z "$httpmethod" ]; then … … 1898 1848 _ret="$?" 1899 1849 if [ "$_ret" != "0" ]; then 1900 if [ -z "$displayError" ] || [ "$displayError" = "0" ]; then 1901 _err "Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: $_ret" 1902 fi 1850 _err "Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: $_ret" 1903 1851 if [ "$DEBUG" ] && [ "$DEBUG" -ge "2" ]; then 1904 1852 _err "Here is the curl dump log:" … … 1956 1904 fi 1957 1905 if [ "$_ret" != "0" ]; then 1958 if [ -z "$displayError" ] || [ "$displayError" = "0" ]; then 1959 _err "Please refer to https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html for error code: $_ret" 1960 fi 1906 _err "Please refer to https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html for error code: $_ret" 1961 1907 fi 1962 1908 _sed_i "s/^ *//g" "$HTTP_HEADER" … … 1972 1918 # url getheader timeout 1973 1919 _get() { 1974 url="$1"1975 onlyheader="$2"1976 t="$3"1977 _sleep_retry_sec=11978 _http_retry_times=01979 _hcode=01980 while [ "${_http_retry_times}" -le "$_HTTP_MAX_RETRY" ]; do1981 [ "$_http_retry_times" = "$_HTTP_MAX_RETRY" ]1982 _lastHCode="$?"1983 _debug "Retrying GET"1984 _get_impl "$url" "$onlyheader" "$t" "$_lastHCode"1985 _hcode="$?"1986 _debug _hcode "$_hcode"1987 if [ "$_hcode" = "0" ]; then1988 break1989 fi1990 _http_retry_times=$(_math $_http_retry_times + 1)1991 _sleep $_sleep_retry_sec1992 done1993 return $_hcode1994 }1995 1996 # url getheader timeout displayError1997 _get_impl() {1998 1920 _debug GET 1999 1921 url="$1" 2000 1922 onlyheader="$2" 2001 1923 t="$3" 2002 displayError="$4"2003 1924 _debug url "$url" 2004 1925 _debug "timeout=$t" 2005 _debug "displayError" "$displayError" 1926 2006 1927 _inithttp 2007 1928 … … 2022 1943 ret=$? 2023 1944 if [ "$ret" != "0" ]; then 2024 if [ -z "$displayError" ] || [ "$displayError" = "0" ]; then 2025 _err "Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: $ret" 2026 fi 1945 _err "Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: $ret" 2027 1946 if [ "$DEBUG" ] && [ "$DEBUG" -ge "2" ]; then 2028 1947 _err "Here is the curl dump log:" … … 2050 1969 fi 2051 1970 if [ "$ret" != "0" ]; then 2052 if [ -z "$displayError" ] || [ "$displayError" = "0" ]; then 2053 _err "Please refer to https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html for error code: $ret" 2054 fi 1971 _err "Please refer to https://www.gnu.org/software/wget/manual/html_node/Exit-Status.html for error code: $ret" 2055 1972 fi 2056 1973 else … … 2108 2025 _headers="$(cat "$HTTP_HEADER")" 2109 2026 _debug2 _headers "$_headers" 2110 _CACHED_NONCE="$(echo "$_headers" | grep -i "Replay-Nonce:" | _head_n 1 | tr -d "\r\n " | cut -d ':' -f 2 | cut -d , -f 1)"2027 _CACHED_NONCE="$(echo "$_headers" | grep -i "Replay-Nonce:" | _head_n 1 | tr -d "\r\n " | cut -d ':' -f 2)" 2111 2028 fi 2112 2029 fi … … 2140 2057 continue 2141 2058 fi 2142 2143 if [ "$url" = "$ACME_NEW_ACCOUNT" ]; then 2059 if [ "$ACME_VERSION" = "2" ]; then 2060 if [ "$url" = "$ACME_NEW_ACCOUNT" ]; then 2061 protected="$JWK_HEADERPLACE_PART1$nonce\", \"url\": \"${url}$JWK_HEADERPLACE_PART2, \"jwk\": $jwk"'}' 2062 elif [ "$url" = "$ACME_REVOKE_CERT" ] && [ "$keyfile" != "$ACCOUNT_KEY_PATH" ]; then 2063 protected="$JWK_HEADERPLACE_PART1$nonce\", \"url\": \"${url}$JWK_HEADERPLACE_PART2, \"jwk\": $jwk"'}' 2064 else 2065 protected="$JWK_HEADERPLACE_PART1$nonce\", \"url\": \"${url}$JWK_HEADERPLACE_PART2, \"kid\": \"${ACCOUNT_URL}\""'}' 2066 fi 2067 else 2144 2068 protected="$JWK_HEADERPLACE_PART1$nonce\", \"url\": \"${url}$JWK_HEADERPLACE_PART2, \"jwk\": $jwk"'}' 2145 elif [ "$url" = "$ACME_REVOKE_CERT" ] && [ "$keyfile" != "$ACCOUNT_KEY_PATH" ]; then 2146 protected="$JWK_HEADERPLACE_PART1$nonce\", \"url\": \"${url}$JWK_HEADERPLACE_PART2, \"jwk\": $jwk"'}' 2147 else 2148 protected="$JWK_HEADERPLACE_PART1$nonce\", \"url\": \"${url}$JWK_HEADERPLACE_PART2, \"kid\": \"${ACCOUNT_URL}\""'}' 2149 fi 2150 2069 fi 2151 2070 _debug3 protected "$protected" 2152 2071 … … 2186 2105 _debug2 response "$response" 2187 2106 2188 _CACHED_NONCE="$(echo "$responseHeaders" | grep -i "Replay-Nonce:" | _head_n 1 | tr -d "\r\n " | cut -d ':' -f 2 | cut -d , -f 1)"2107 _CACHED_NONCE="$(echo "$responseHeaders" | grep -i "Replay-Nonce:" | _head_n 1 | tr -d "\r\n " | cut -d ':' -f 2)" 2189 2108 2190 2109 if ! _startswith "$code" "2"; then … … 2197 2116 if _contains "$_body" "JWS has invalid anti-replay nonce" || _contains "$_body" "JWS has an invalid anti-replay nonce"; then 2198 2117 _info "It seems the CA server is busy now, let's wait and retry. Sleeping $_sleep_retry_sec seconds." 2199 _CACHED_NONCE=""2200 _sleep $_sleep_retry_sec2201 continue2202 fi2203 if _contains "$_body" "The Replay Nonce is not recognized"; then2204 _info "The replay Nonce is not valid, let's get a new one, Sleeping $_sleep_retry_sec seconds."2205 2118 _CACHED_NONCE="" 2206 2119 _sleep $_sleep_retry_sec … … 2334 2247 fi 2335 2248 _saved=$(_readdomainconf "SAVED_$_rac_key") 2336 eval "export $_rac_key=\" \$_saved\""2249 eval "export $_rac_key=\"$_saved\"" 2337 2250 } 2338 2251 … … 2363 2276 _clearaccountconf() { 2364 2277 _clear_conf "$ACCOUNT_CONF_PATH" "$1" 2365 }2366 2367 #key2368 _clearaccountconf_mutable() {2369 _clearaccountconf "SAVED_$1"2370 #remove later2371 _clearaccountconf "$1"2372 2278 } 2373 2279 … … 2425 2331 echo 'Content-Length\: $_content_len'; \ 2426 2332 echo ''; \ 2427 printf '%s''$content';" &2333 printf -- '$content';" & 2428 2334 serverproc="$!" 2429 2335 } … … 2600 2506 } 2601 2507 2602 _clearAPI() {2603 ACME_NEW_ACCOUNT=""2604 ACME_KEY_CHANGE=""2605 ACME_NEW_AUTHZ=""2606 ACME_NEW_ORDER=""2607 ACME_REVOKE_CERT=""2608 ACME_NEW_NONCE=""2609 ACME_AGREEMENT=""2610 }2611 2612 2508 #server 2613 2509 _initAPI() { … … 2615 2511 _debug "_init api for server: $_api_server" 2616 2512 2617 MAX_API_RETRY_TIMES=10 2618 _sleep_retry_sec=10 2619 _request_retry_times=0 2620 while [ -z "$ACME_NEW_ACCOUNT" ] && [ "${_request_retry_times}" -lt "$MAX_API_RETRY_TIMES" ]; do 2621 _request_retry_times=$(_math "$_request_retry_times" + 1) 2513 if [ -z "$ACME_NEW_ACCOUNT" ]; then 2622 2514 response=$(_get "$_api_server") 2623 2515 if [ "$?" != "0" ]; then 2624 2516 _debug2 "response" "$response" 2625 _info "Can not init api for: $_api_server." 2626 _info "Sleep $_sleep_retry_sec and retry." 2627 _sleep "$_sleep_retry_sec" 2628 continue 2517 _err "Can not init api." 2518 return 1 2629 2519 fi 2630 2520 response=$(echo "$response" | _json_decode) 2631 2521 _debug2 "response" "$response" 2632 2522 2633 ACME_KEY_CHANGE=$(echo "$response" | _egrep_o 'keyChange" *: *"[^"]*"' | cut -d '"' -f 3) 2523 ACME_KEY_CHANGE=$(echo "$response" | _egrep_o 'key-change" *: *"[^"]*"' | cut -d '"' -f 3) 2524 if [ -z "$ACME_KEY_CHANGE" ]; then 2525 ACME_KEY_CHANGE=$(echo "$response" | _egrep_o 'keyChange" *: *"[^"]*"' | cut -d '"' -f 3) 2526 fi 2634 2527 export ACME_KEY_CHANGE 2635 2528 2636 ACME_NEW_AUTHZ=$(echo "$response" | _egrep_o 'newAuthz" *: *"[^"]*"' | cut -d '"' -f 3) 2529 ACME_NEW_AUTHZ=$(echo "$response" | _egrep_o 'new-authz" *: *"[^"]*"' | cut -d '"' -f 3) 2530 if [ -z "$ACME_NEW_AUTHZ" ]; then 2531 ACME_NEW_AUTHZ=$(echo "$response" | _egrep_o 'newAuthz" *: *"[^"]*"' | cut -d '"' -f 3) 2532 fi 2637 2533 export ACME_NEW_AUTHZ 2638 2534 2639 ACME_NEW_ORDER=$(echo "$response" | _egrep_o 'newOrder" *: *"[^"]*"' | cut -d '"' -f 3) 2535 ACME_NEW_ORDER=$(echo "$response" | _egrep_o 'new-cert" *: *"[^"]*"' | cut -d '"' -f 3) 2536 ACME_NEW_ORDER_RES="new-cert" 2537 if [ -z "$ACME_NEW_ORDER" ]; then 2538 ACME_NEW_ORDER=$(echo "$response" | _egrep_o 'new-order" *: *"[^"]*"' | cut -d '"' -f 3) 2539 ACME_NEW_ORDER_RES="new-order" 2540 if [ -z "$ACME_NEW_ORDER" ]; then 2541 ACME_NEW_ORDER=$(echo "$response" | _egrep_o 'newOrder" *: *"[^"]*"' | cut -d '"' -f 3) 2542 fi 2543 fi 2640 2544 export ACME_NEW_ORDER 2641 2642 ACME_NEW_ACCOUNT=$(echo "$response" | _egrep_o 'newAccount" *: *"[^"]*"' | cut -d '"' -f 3) 2545 export ACME_NEW_ORDER_RES 2546 2547 ACME_NEW_ACCOUNT=$(echo "$response" | _egrep_o 'new-reg" *: *"[^"]*"' | cut -d '"' -f 3) 2548 ACME_NEW_ACCOUNT_RES="new-reg" 2549 if [ -z "$ACME_NEW_ACCOUNT" ]; then 2550 ACME_NEW_ACCOUNT=$(echo "$response" | _egrep_o 'new-account" *: *"[^"]*"' | cut -d '"' -f 3) 2551 ACME_NEW_ACCOUNT_RES="new-account" 2552 if [ -z "$ACME_NEW_ACCOUNT" ]; then 2553 ACME_NEW_ACCOUNT=$(echo "$response" | _egrep_o 'newAccount" *: *"[^"]*"' | cut -d '"' -f 3) 2554 if [ "$ACME_NEW_ACCOUNT" ]; then 2555 export ACME_VERSION=2 2556 fi 2557 fi 2558 fi 2643 2559 export ACME_NEW_ACCOUNT 2644 2645 ACME_REVOKE_CERT=$(echo "$response" | _egrep_o 'revokeCert" *: *"[^"]*"' | cut -d '"' -f 3) 2560 export ACME_NEW_ACCOUNT_RES 2561 2562 ACME_REVOKE_CERT=$(echo "$response" | _egrep_o 'revoke-cert" *: *"[^"]*"' | cut -d '"' -f 3) 2563 if [ -z "$ACME_REVOKE_CERT" ]; then 2564 ACME_REVOKE_CERT=$(echo "$response" | _egrep_o 'revokeCert" *: *"[^"]*"' | cut -d '"' -f 3) 2565 fi 2646 2566 export ACME_REVOKE_CERT 2647 2567 2648 ACME_NEW_NONCE=$(echo "$response" | _egrep_o 'newNonce" *: *"[^"]*"' | cut -d '"' -f 3) 2568 ACME_NEW_NONCE=$(echo "$response" | _egrep_o 'new-nonce" *: *"[^"]*"' | cut -d '"' -f 3) 2569 if [ -z "$ACME_NEW_NONCE" ]; then 2570 ACME_NEW_NONCE=$(echo "$response" | _egrep_o 'newNonce" *: *"[^"]*"' | cut -d '"' -f 3) 2571 fi 2649 2572 export ACME_NEW_NONCE 2650 2573 2651 ACME_AGREEMENT=$(echo "$response" | _egrep_o 'termsOfService" *: *"[^"]*"' | cut -d '"' -f 3) 2574 ACME_AGREEMENT=$(echo "$response" | _egrep_o 'terms-of-service" *: *"[^"]*"' | cut -d '"' -f 3) 2575 if [ -z "$ACME_AGREEMENT" ]; then 2576 ACME_AGREEMENT=$(echo "$response" | _egrep_o 'termsOfService" *: *"[^"]*"' | cut -d '"' -f 3) 2577 fi 2652 2578 export ACME_AGREEMENT 2653 2579 … … 2659 2585 _debug "ACME_AGREEMENT" "$ACME_AGREEMENT" 2660 2586 _debug "ACME_NEW_NONCE" "$ACME_NEW_NONCE" 2661 if [ "$ACME_NEW_ACCOUNT" ] && [ "$ACME_NEW_ORDER" ]; then 2662 return 0 2663 fi 2664 _info "Sleep $_sleep_retry_sec and retry." 2665 _sleep "$_sleep_retry_sec" 2666 done 2667 if [ "$ACME_NEW_ACCOUNT" ] && [ "$ACME_NEW_ORDER" ]; then 2668 return 0 2669 fi 2670 _err "Can not init api, for $_api_server" 2671 return 1 2587 _debug "ACME_VERSION" "$ACME_VERSION" 2588 2589 fi 2672 2590 } 2673 2591 … … 2713 2631 _debug2 "_ACME_SERVER_HOST" "$_ACME_SERVER_HOST" 2714 2632 2715 _ACME_SERVER_PATH="$(echo "$ACME_DIRECTORY" | cut -d : -f 2- | tr -s / | cut -d / -f 3-)" 2716 _debug2 "_ACME_SERVER_PATH" "$_ACME_SERVER_PATH" 2717 2718 CA_DIR="$CA_HOME/$_ACME_SERVER_HOST/$_ACME_SERVER_PATH" 2633 CA_DIR="$CA_HOME/$_ACME_SERVER_HOST" 2634 2719 2635 _DEFAULT_CA_CONF="$CA_DIR/ca.conf" 2636 2720 2637 if [ -z "$CA_CONF" ]; then 2721 2638 CA_CONF="$_DEFAULT_CA_CONF" … … 2723 2640 _debug3 CA_CONF "$CA_CONF" 2724 2641 2725 _OLD_CADIR="$CA_HOME/$_ACME_SERVER_HOST" 2726 _OLD_ACCOUNT_KEY="$_OLD_CADIR/account.key" 2727 _OLD_ACCOUNT_JSON="$_OLD_CADIR/account.json" 2728 _OLD_CA_CONF="$_OLD_CADIR/ca.conf" 2642 if [ -f "$CA_CONF" ]; then 2643 . "$CA_CONF" 2644 fi 2645 2646 if [ -z "$ACME_DIR" ]; then 2647 ACME_DIR="/home/.acme" 2648 fi 2649 2650 if [ -z "$APACHE_CONF_BACKUP_DIR" ]; then 2651 APACHE_CONF_BACKUP_DIR="$LE_CONFIG_HOME" 2652 fi 2653 2654 if [ -z "$USER_AGENT" ]; then 2655 USER_AGENT="$DEFAULT_USER_AGENT" 2656 fi 2657 2658 if [ -z "$HTTP_HEADER" ]; then 2659 HTTP_HEADER="$LE_CONFIG_HOME/http.header" 2660 fi 2661 2662 _OLD_ACCOUNT_KEY="$LE_WORKING_DIR/account.key" 2663 _OLD_ACCOUNT_JSON="$LE_WORKING_DIR/account.json" 2729 2664 2730 2665 _DEFAULT_ACCOUNT_KEY_PATH="$CA_DIR/account.key" … … 2732 2667 if [ -z "$ACCOUNT_KEY_PATH" ]; then 2733 2668 ACCOUNT_KEY_PATH="$_DEFAULT_ACCOUNT_KEY_PATH" 2734 if [ -f "$_OLD_ACCOUNT_KEY" ] && ! [ -f "$ACCOUNT_KEY_PATH" ]; then2735 mkdir -p "$CA_DIR"2736 mv "$_OLD_ACCOUNT_KEY" "$ACCOUNT_KEY_PATH"2737 fi2738 2669 fi 2739 2670 2740 2671 if [ -z "$ACCOUNT_JSON_PATH" ]; then 2741 2672 ACCOUNT_JSON_PATH="$_DEFAULT_ACCOUNT_JSON_PATH" 2742 if [ -f "$_OLD_ACCOUNT_JSON" ] && ! [ -f "$ACCOUNT_JSON_PATH" ]; then2743 mkdir -p "$CA_DIR"2744 mv "$_OLD_ACCOUNT_JSON" "$ACCOUNT_JSON_PATH"2745 fi2746 fi2747 2748 if [ -f "$_OLD_CA_CONF" ] && ! [ -f "$CA_CONF" ]; then2749 mkdir -p "$CA_DIR"2750 mv "$_OLD_CA_CONF" "$CA_CONF"2751 fi2752 2753 if [ -f "$CA_CONF" ]; then2754 . "$CA_CONF"2755 fi2756 2757 if [ -z "$ACME_DIR" ]; then2758 ACME_DIR="/home/.acme"2759 fi2760 2761 if [ -z "$APACHE_CONF_BACKUP_DIR" ]; then2762 APACHE_CONF_BACKUP_DIR="$LE_CONFIG_HOME"2763 fi2764 2765 if [ -z "$USER_AGENT" ]; then2766 USER_AGENT="$DEFAULT_USER_AGENT"2767 fi2768 2769 if [ -z "$HTTP_HEADER" ]; then2770 HTTP_HEADER="$LE_CONFIG_HOME/http.header"2771 2673 fi 2772 2674 … … 3168 3070 for included in $(cat "$2" | tr "\t" " " | grep "^ *include *.*;" | sed "s/include //" | tr -d " ;"); do 3169 3071 _debug "check included $included" 3170 if ! _startswith "$included" "/" && _exists dirname; then3171 _relpath="$(dirname "$_c_file")"3172 _debug "_relpath" "$_relpath"3173 included="$_relpath/$included"3174 fi3175 3072 if _checkConf "$1" "$included"; then 3176 3073 return 0 … … 3383 3280 _info "Run pre hook:'$_chk_pre_hook'" 3384 3281 if ! ( 3385 export Le_Domain="$_chk_main_domain"3386 export Le_Alt="$_chk_alt_domains"3387 3282 cd "$DOMAIN_PATH" && eval "$_chk_pre_hook" 3388 3283 ); then … … 3446 3341 netprc="$(echo "$_netprc" | grep "$_checkaddr")" 3447 3342 if [ -z "$netprc" ]; then 3448 netprc="$(echo "$_netprc" | grep "$LOCAL_ANY_ADDRESS :$_checkport")"3343 netprc="$(echo "$_netprc" | grep "$LOCAL_ANY_ADDRESS")" 3449 3344 fi 3450 3345 if [ "$netprc" ]; then … … 3603 3498 3604 3499 mkdir -p "$CA_DIR" 3500 if [ ! -f "$ACCOUNT_KEY_PATH" ] && [ -f "$_OLD_ACCOUNT_KEY" ]; then 3501 _info "mv $_OLD_ACCOUNT_KEY to $ACCOUNT_KEY_PATH" 3502 mv "$_OLD_ACCOUNT_KEY" "$ACCOUNT_KEY_PATH" 3503 fi 3504 3505 if [ ! -f "$ACCOUNT_JSON_PATH" ] && [ -f "$_OLD_ACCOUNT_JSON" ]; then 3506 _info "mv $_OLD_ACCOUNT_JSON to $ACCOUNT_JSON_PATH" 3507 mv "$_OLD_ACCOUNT_JSON" "$ACCOUNT_JSON_PATH" 3508 fi 3605 3509 3606 3510 if [ ! -f "$ACCOUNT_KEY_PATH" ]; then … … 3626 3530 _savecaconf "CA_EMAIL" "$_email" 3627 3531 fi 3628 3629 if [ "$ACME_DIRECTORY" = "$CA_ZEROSSL" ]; then 3630 if [ -z "$_eab_id" ] || [ -z "$_eab_hmac_key" ]; then 3631 _info "No EAB credentials found for ZeroSSL, let's get one" 3632 if [ -z "$_email" ]; then 3633 _info "$(__green "$PROJECT_NAME is using ZeroSSL as default CA now.")" 3634 _info "$(__green "Please update your account with an email address first.")" 3635 _info "$(__green "$PROJECT_ENTRY --register-account -m my@example.com")" 3636 _info "See: $(__green "$_ZEROSSL_WIKI")" 3637 return 1 3638 fi 3639 _eabresp=$(_post "email=$_email" $_ZERO_EAB_ENDPOINT) 3640 if [ "$?" != "0" ]; then 3641 _debug2 "$_eabresp" 3642 _err "Can not get EAB credentials from ZeroSSL." 3643 return 1 3644 fi 3645 _secure_debug2 _eabresp "$_eabresp" 3646 _eab_id="$(echo "$_eabresp" | tr ',}' '\n\n' | grep '"eab_kid"' | cut -d : -f 2 | tr -d '"')" 3647 _secure_debug2 _eab_id "$_eab_id" 3648 if [ -z "$_eab_id" ]; then 3649 _err "Can not resolve _eab_id" 3650 return 1 3651 fi 3652 _eab_hmac_key="$(echo "$_eabresp" | tr ',}' '\n\n' | grep '"eab_hmac_key"' | cut -d : -f 2 | tr -d '"')" 3653 _secure_debug2 _eab_hmac_key "$_eab_hmac_key" 3654 if [ -z "$_eab_hmac_key" ]; then 3655 _err "Can not resolve _eab_hmac_key" 3656 return 1 3657 fi 3658 _savecaconf CA_EAB_KEY_ID "$_eab_id" 3659 _savecaconf CA_EAB_HMAC_KEY "$_eab_hmac_key" 3660 fi 3661 fi 3662 if [ "$_eab_id" ] && [ "$_eab_hmac_key" ]; then 3663 eab_protected="{\"alg\":\"HS256\",\"kid\":\"$_eab_id\",\"url\":\"${ACME_NEW_ACCOUNT}\"}" 3664 _debug3 eab_protected "$eab_protected" 3665 3666 eab_protected64=$(printf "%s" "$eab_protected" | _base64 | _url_replace) 3667 _debug3 eab_protected64 "$eab_protected64" 3668 3669 eab_payload64=$(printf "%s" "$jwk" | _base64 | _url_replace) 3670 _debug3 eab_payload64 "$eab_payload64" 3671 3672 eab_sign_t="$eab_protected64.$eab_payload64" 3673 _debug3 eab_sign_t "$eab_sign_t" 3674 3675 key_hex="$(_durl_replace_base64 "$_eab_hmac_key" | _dbase64 multi | _hex_dump | tr -d ' ')" 3676 _debug3 key_hex "$key_hex" 3677 3678 eab_signature=$(printf "%s" "$eab_sign_t" | _hmac sha256 $key_hex | _base64 | _url_replace) 3679 _debug3 eab_signature "$eab_signature" 3680 3681 externalBinding=",\"externalAccountBinding\":{\"protected\":\"$eab_protected64\", \"payload\":\"$eab_payload64\", \"signature\":\"$eab_signature\"}" 3682 _debug3 externalBinding "$externalBinding" 3683 fi 3684 if [ "$_email" ]; then 3685 email_sg="\"contact\": [\"mailto:$_email\"], " 3686 fi 3687 regjson="{$email_sg\"termsOfServiceAgreed\": true$externalBinding}" 3532 if [ "$ACME_VERSION" = "2" ]; then 3533 if [ "$ACME_DIRECTORY" = "$CA_ZEROSSL" ]; then 3534 if [ -z "$_eab_id" ] || [ -z "$_eab_hmac_key" ]; then 3535 _info "No EAB credentials found for ZeroSSL, let's get one" 3536 if [ -z "$_email" ]; then 3537 _err "Please provide a email address for ZeroSSL account." 3538 _err "See ZeroSSL usage: $_ZEROSSL_WIKI" 3539 return 1 3540 fi 3541 _eabresp=$(_post "email=$_email" $_ZERO_EAB_ENDPOINT) 3542 if [ "$?" != "0" ]; then 3543 _debug2 "$_eabresp" 3544 _err "Can not get EAB credentials from ZeroSSL." 3545 return 1 3546 fi 3547 _eab_id="$(echo "$_eabresp" | tr ',}' '\n' | grep '"eab_kid"' | cut -d : -f 2 | tr -d '"')" 3548 if [ -z "$_eab_id" ]; then 3549 _err "Can not resolve _eab_id" 3550 return 1 3551 fi 3552 _eab_hmac_key="$(echo "$_eabresp" | tr ',}' '\n' | grep '"eab_hmac_key"' | cut -d : -f 2 | tr -d '"')" 3553 if [ -z "$_eab_hmac_key" ]; then 3554 _err "Can not resolve _eab_hmac_key" 3555 return 1 3556 fi 3557 _savecaconf CA_EAB_KEY_ID "$_eab_id" 3558 _savecaconf CA_EAB_HMAC_KEY "$_eab_hmac_key" 3559 fi 3560 fi 3561 if [ "$_eab_id" ] && [ "$_eab_hmac_key" ]; then 3562 eab_protected="{\"alg\":\"HS256\",\"kid\":\"$_eab_id\",\"url\":\"${ACME_NEW_ACCOUNT}\"}" 3563 _debug3 eab_protected "$eab_protected" 3564 3565 eab_protected64=$(printf "%s" "$eab_protected" | _base64 | _url_replace) 3566 _debug3 eab_protected64 "$eab_protected64" 3567 3568 eab_payload64=$(printf "%s" "$jwk" | _base64 | _url_replace) 3569 _debug3 eab_payload64 "$eab_payload64" 3570 3571 eab_sign_t="$eab_protected64.$eab_payload64" 3572 _debug3 eab_sign_t "$eab_sign_t" 3573 3574 key_hex="$(_durl_replace_base64 "$_eab_hmac_key" | _dbase64 | _hex_dump | tr -d ' ')" 3575 _debug3 key_hex "$key_hex" 3576 3577 eab_signature=$(printf "%s" "$eab_sign_t" | _hmac sha256 $key_hex | _base64 | _url_replace) 3578 _debug3 eab_signature "$eab_signature" 3579 3580 externalBinding=",\"externalAccountBinding\":{\"protected\":\"$eab_protected64\", \"payload\":\"$eab_payload64\", \"signature\":\"$eab_signature\"}" 3581 _debug3 externalBinding "$externalBinding" 3582 fi 3583 if [ "$_email" ]; then 3584 email_sg="\"contact\": [\"mailto:$_email\"], " 3585 fi 3586 regjson="{$email_sg\"termsOfServiceAgreed\": true$externalBinding}" 3587 else 3588 _reg_res="$ACME_NEW_ACCOUNT_RES" 3589 regjson='{"resource": "'$_reg_res'", "terms-of-service-agreed": true, "agreement": "'$ACME_AGREEMENT'"}' 3590 if [ "$_email" ]; then 3591 regjson='{"resource": "'$_reg_res'", "contact": ["mailto:'$_email'"], "terms-of-service-agreed": true, "agreement": "'$ACME_AGREEMENT'"}' 3592 fi 3593 fi 3688 3594 3689 3595 _info "Registering account: $ACME_DIRECTORY" … … 3740 3646 _initpath 3741 3647 3648 if [ ! -f "$ACCOUNT_KEY_PATH" ] && [ -f "$_OLD_ACCOUNT_KEY" ]; then 3649 _info "mv $_OLD_ACCOUNT_KEY to $ACCOUNT_KEY_PATH" 3650 mv "$_OLD_ACCOUNT_KEY" "$ACCOUNT_KEY_PATH" 3651 fi 3652 3653 if [ ! -f "$ACCOUNT_JSON_PATH" ] && [ -f "$_OLD_ACCOUNT_JSON" ]; then 3654 _info "mv $_OLD_ACCOUNT_JSON to $ACCOUNT_JSON_PATH" 3655 mv "$_OLD_ACCOUNT_JSON" "$ACCOUNT_JSON_PATH" 3656 fi 3657 3742 3658 if [ ! -f "$ACCOUNT_KEY_PATH" ]; then 3743 3659 _err "Account key is not found at: $ACCOUNT_KEY_PATH" … … 3760 3676 3761 3677 _email="$(_getAccountEmail)" 3762 3763 if [ "$ACCOUNT_EMAIL" ]; then 3764 updjson='{"contact": ["mailto:'$_email'"]}' 3765 else 3766 updjson='{"contact": []}' 3767 fi 3768 3678 if [ "$ACME_VERSION" = "2" ]; then 3679 if [ "$ACCOUNT_EMAIL" ]; then 3680 updjson='{"contact": ["mailto:'$_email'"]}' 3681 else 3682 updjson='{"contact": []}' 3683 fi 3684 else 3685 # ACMEv1: Updates happen the same way a registration is done. 3686 # https://tools.ietf.org/html/draft-ietf-acme-acme-01#section-6.3 3687 _regAccount 3688 return 3689 fi 3690 3691 # this part handles ACMEv2 account updates. 3769 3692 _send_signed_request "$_accUri" "$updjson" 3770 3693 … … 3782 3705 _initpath 3783 3706 3707 if [ ! -f "$ACCOUNT_KEY_PATH" ] && [ -f "$_OLD_ACCOUNT_KEY" ]; then 3708 _info "mv $_OLD_ACCOUNT_KEY to $ACCOUNT_KEY_PATH" 3709 mv "$_OLD_ACCOUNT_KEY" "$ACCOUNT_KEY_PATH" 3710 fi 3711 3712 if [ ! -f "$ACCOUNT_JSON_PATH" ] && [ -f "$_OLD_ACCOUNT_JSON" ]; then 3713 _info "mv $_OLD_ACCOUNT_JSON to $ACCOUNT_JSON_PATH" 3714 mv "$_OLD_ACCOUNT_JSON" "$ACCOUNT_JSON_PATH" 3715 fi 3716 3784 3717 if [ ! -f "$ACCOUNT_KEY_PATH" ]; then 3785 3718 _err "Account key is not found at: $ACCOUNT_KEY_PATH" … … 3801 3734 _initAPI 3802 3735 3803 _djson="{\"status\":\"deactivated\"}" 3804 3736 if [ "$ACME_VERSION" = "2" ]; then 3737 _djson="{\"status\":\"deactivated\"}" 3738 else 3739 _djson="{\"resource\": \"reg\", \"status\":\"deactivated\"}" 3740 fi 3805 3741 if _send_signed_request "$_accUri" "$_djson" && _contains "$response" '"deactivated"'; then 3806 3742 _info "Deactivate account success for $_accUri." … … 3907 3843 _t_vtype="$3" 3908 3844 _debug2 _t_vtype "$_t_vtype" 3909 3910 _send_signed_request "$_t_url" "{}" 3911 3845 if [ "$ACME_VERSION" = "2" ]; then 3846 _send_signed_request "$_t_url" "{}" 3847 else 3848 _send_signed_request "$_t_url" "{\"resource\": \"challenge\", \"type\": \"$_t_vtype\", \"keyAuthorization\": \"$_t_key_authz\"}" 3849 fi 3912 3850 } 3913 3851 … … 3952 3890 #checks if cf server is available 3953 3891 _ns_is_available_cf() { 3954 if _get "https://cloudflare-dns.com" "" 1 >/dev/null 2>&1; then 3955 return 0 3956 else 3957 return 1 3958 fi 3959 } 3960 3961 _ns_is_available_google() { 3962 if _get "https://dns.google" "" 1 >/dev/null 2>&1; then 3892 if _get "https://cloudflare-dns.com" >/dev/null 2>&1; then 3963 3893 return 0 3964 3894 else … … 3972 3902 _cf_ld_type="$2" 3973 3903 _cf_ep="https://dns.google/resolve" 3974 _ns_lookup_impl "$_cf_ep" "$_cf_ld" "$_cf_ld_type"3975 }3976 3977 _ns_is_available_ali() {3978 if _get "https://dns.alidns.com" "" 1 >/dev/null 2>&1; then3979 return 03980 else3981 return 13982 fi3983 }3984 3985 #domain, type3986 _ns_lookup_ali() {3987 _cf_ld="$1"3988 _cf_ld_type="$2"3989 _cf_ep="https://dns.alidns.com/resolve"3990 _ns_lookup_impl "$_cf_ep" "$_cf_ld" "$_cf_ld_type"3991 }3992 3993 _ns_is_available_dp() {3994 if _get "https://doh.pub" "" 1 >/dev/null 2>&1; then3995 return 03996 else3997 return 13998 fi3999 }4000 4001 #dnspod4002 _ns_lookup_dp() {4003 _cf_ld="$1"4004 _cf_ld_type="$2"4005 _cf_ep="https://doh.pub/dns-query"4006 3904 _ns_lookup_impl "$_cf_ep" "$_cf_ld" "$_cf_ld_type" 4007 3905 } … … 4014 3912 _debug "Use cloudflare doh server" 4015 3913 export DOH_USE=$DOH_CLOUDFLARE 4016 el if _ns_is_available_google; then3914 else 4017 3915 _debug "Use google doh server" 4018 3916 export DOH_USE=$DOH_GOOGLE 4019 elif _ns_is_available_ali; then4020 _debug "Use aliyun doh server"4021 export DOH_USE=$DOH_ALI4022 elif _ns_is_available_dp; then4023 _debug "Use dns pod doh server"4024 export DOH_USE=$DOH_DP4025 else4026 _err "No doh"4027 3917 fi 4028 3918 fi … … 4030 3920 if [ "$DOH_USE" = "$DOH_CLOUDFLARE" ] || [ -z "$DOH_USE" ]; then 4031 3921 _ns_lookup_cf "$@" 4032 el if [ "$DOH_USE" = "$DOH_GOOGLE" ]; then3922 else 4033 3923 _ns_lookup_google "$@" 4034 elif [ "$DOH_USE" = "$DOH_ALI" ]; then4035 _ns_lookup_ali "$@"4036 elif [ "$DOH_USE" = "$DOH_DP" ]; then4037 _ns_lookup_dp "$@"4038 else4039 _err "Unknown doh provider: DOH_USE=$DOH_USE"4040 3924 fi 4041 3925 … … 4062 3946 _ns_purge_cf "$_p_txtdomain" "TXT" 4063 3947 else 4064 _debug "no purge api for this dohapi, just sleep 5 secs"3948 _debug "no purge api for google dns api, just sleep 5 secs" 4065 3949 _sleep 5 4066 3950 fi … … 4075 3959 4076 3960 while [ "$(_time)" -le "$_end_time" ]; do 4077 _info "You can use '--dnssleep' to disable public dns checks."4078 _info "See: $_DNSCHECK_WIKI"4079 3961 _left="" 4080 3962 for entry in $dns_entries; do … … 4124 4006 4125 4007 #file 4126 _get_c hain_issuers() {4008 _get_cert_issuers() { 4127 4009 _cfile="$1" 4128 if _contains "$(${ACME_OPENSSL_BIN:-openssl} help crl2pkcs7 2>&1)" "Usage: crl2pkcs7" || _contains "$(${ACME_OPENSSL_BIN:-openssl} crl2pkcs7 -help 2>&1)" "Usage: crl2pkcs7" || _contains "$(${ACME_OPENSSL_BIN:-openssl} crl2pkcs7 help 2>&1)" "unknown option help"; then 4129 ${ACME_OPENSSL_BIN:-openssl} crl2pkcs7 -nocrl -certfile $_cfile | ${ACME_OPENSSL_BIN:-openssl} pkcs7 -print_certs -text -noout | grep -i 'Issuer:' | _egrep_o "CN *=[^,]*" | cut -d = -f 2 4130 else 4131 _cindex=1 4132 for _startn in $(grep -n -- "$BEGIN_CERT" "$_cfile" | cut -d : -f 1); do 4133 _endn="$(grep -n -- "$END_CERT" "$_cfile" | cut -d : -f 1 | _head_n $_cindex | _tail_n 1)" 4134 _debug2 "_startn" "$_startn" 4135 _debug2 "_endn" "$_endn" 4136 if [ "$DEBUG" ]; then 4137 _debug2 "cert$_cindex" "$(sed -n "$_startn,${_endn}p" "$_cfile")" 4138 fi 4139 sed -n "$_startn,${_endn}p" "$_cfile" | ${ACME_OPENSSL_BIN:-openssl} x509 -text -noout | grep 'Issuer:' | _egrep_o "CN *=[^,]*" | cut -d = -f 2 | sed "s/ *\(.*\)/\1/" 4140 _cindex=$(_math $_cindex + 1) 4141 done 4142 fi 4143 } 4144 4145 # 4146 _get_chain_subjects() { 4147 _cfile="$1" 4148 if _contains "$(${ACME_OPENSSL_BIN:-openssl} help crl2pkcs7 2>&1)" "Usage: crl2pkcs7" || _contains "$(${ACME_OPENSSL_BIN:-openssl} crl2pkcs7 -help 2>&1)" "Usage: crl2pkcs7" || _contains "$(${ACME_OPENSSL_BIN:-openssl} crl2pkcs7 help 2>&1)" "unknown option help"; then 4149 ${ACME_OPENSSL_BIN:-openssl} crl2pkcs7 -nocrl -certfile $_cfile | ${ACME_OPENSSL_BIN:-openssl} pkcs7 -print_certs -text -noout | grep -i 'Subject:' | _egrep_o "CN *=[^,]*" | cut -d = -f 2 4150 else 4151 _cindex=1 4152 for _startn in $(grep -n -- "$BEGIN_CERT" "$_cfile" | cut -d : -f 1); do 4153 _endn="$(grep -n -- "$END_CERT" "$_cfile" | cut -d : -f 1 | _head_n $_cindex | _tail_n 1)" 4154 _debug2 "_startn" "$_startn" 4155 _debug2 "_endn" "$_endn" 4156 if [ "$DEBUG" ]; then 4157 _debug2 "cert$_cindex" "$(sed -n "$_startn,${_endn}p" "$_cfile")" 4158 fi 4159 sed -n "$_startn,${_endn}p" "$_cfile" | ${ACME_OPENSSL_BIN:-openssl} x509 -text -noout | grep -i 'Subject:' | _egrep_o "CN *=[^,]*" | cut -d = -f 2 | sed "s/ *\(.*\)/\1/" 4160 _cindex=$(_math $_cindex + 1) 4161 done 4010 if _contains "$(${ACME_OPENSSL_BIN:-openssl} help crl2pkcs7 2>&1)" "Usage: crl2pkcs7" || _contains "$(${ACME_OPENSSL_BIN:-openssl} crl2pkcs7 help 2>&1)" "unknown option help"; then 4011 ${ACME_OPENSSL_BIN:-openssl} crl2pkcs7 -nocrl -certfile $_cfile | ${ACME_OPENSSL_BIN:-openssl} pkcs7 -print_certs -text -noout | grep 'Issuer:' | _egrep_o "CN *=[^,]*" | cut -d = -f 2 4012 else 4013 ${ACME_OPENSSL_BIN:-openssl} x509 -in $_cfile -text -noout | grep 'Issuer:' | _egrep_o "CN *=[^,]*" | cut -d = -f 2 4162 4014 fi 4163 4015 } … … 4167 4019 _cfile="$1" 4168 4020 _missuer="$2" 4169 _fissuers="$(_get_c hain_issuers $_cfile)"4021 _fissuers="$(_get_cert_issuers $_cfile)" 4170 4022 _debug2 _fissuers "$_fissuers" 4171 _rootissuer="$(echo "$_fissuers" | _lower_case | _tail_n 1)" 4172 _debug2 _rootissuer "$_rootissuer" 4023 if _contains "$_fissuers" "$_missuer"; then 4024 return 0 4025 fi 4026 _fissuers="$(echo "$_fissuers" | _lower_case)" 4173 4027 _missuer="$(echo "$_missuer" | _lower_case)" 4174 _contains "$_ rootissuer" "$_missuer"4028 _contains "$_fissuers" "$_missuer" 4175 4029 } 4176 4030 … … 4212 4066 _initpath "$_main_domain" "$_key_length" 4213 4067 mkdir -p "$DOMAIN_PATH" 4214 elif ! _hasfield "$_web_roots" "$W_DNS"; then4215 Le_OrderFinalize=""4216 Le_LinkOrder=""4217 Le_LinkCert=""4218 4068 fi 4219 4069 … … 4225 4075 _debug "Using ACME_DIRECTORY: $ACME_DIRECTORY" 4226 4076 4227 if ! _initAPI; then 4228 return 1 4229 fi 4077 _initAPI 4230 4078 4231 4079 if [ -f "$DOMAIN_CONF" ]; then … … 4331 4179 dvsep=',' 4332 4180 if [ -z "$vlist" ]; then 4333 #make new order request 4334 _identifiers="{\"type\":\"dns\",\"value\":\"$(_idn "$_main_domain")\"}" 4335 _w_index=1 4336 while true; do 4337 d="$(echo "$_alt_domains," | cut -d , -f "$_w_index")" 4338 _w_index="$(_math "$_w_index" + 1)" 4339 _debug d "$d" 4340 if [ -z "$d" ]; then 4341 break 4342 fi 4343 _identifiers="$_identifiers,{\"type\":\"dns\",\"value\":\"$(_idn "$d")\"}" 4344 done 4345 _debug2 _identifiers "$_identifiers" 4346 if ! _send_signed_request "$ACME_NEW_ORDER" "{\"identifiers\": [$_identifiers]}"; then 4347 _err "Create new order error." 4348 _clearup 4349 _on_issue_err "$_post_hook" 4350 return 1 4351 fi 4352 Le_LinkOrder="$(echo "$responseHeaders" | grep -i '^Location.*$' | _tail_n 1 | tr -d "\r\n " | cut -d ":" -f 2-)" 4353 _debug Le_LinkOrder "$Le_LinkOrder" 4354 Le_OrderFinalize="$(echo "$response" | _egrep_o '"finalize" *: *"[^"]*"' | cut -d '"' -f 4)" 4355 _debug Le_OrderFinalize "$Le_OrderFinalize" 4356 if [ -z "$Le_OrderFinalize" ]; then 4357 _err "Create new order error. Le_OrderFinalize not found. $response" 4358 _clearup 4359 _on_issue_err "$_post_hook" 4360 return 1 4361 fi 4362 4363 #for dns manual mode 4364 _savedomainconf "Le_OrderFinalize" "$Le_OrderFinalize" 4365 4366 _authorizations_seg="$(echo "$response" | _json_decode | _egrep_o '"authorizations" *: *\[[^\[]*\]' | cut -d '[' -f 2 | tr -d ']' | tr -d '"')" 4367 _debug2 _authorizations_seg "$_authorizations_seg" 4368 if [ -z "$_authorizations_seg" ]; then 4369 _err "_authorizations_seg not found." 4370 _clearup 4371 _on_issue_err "$_post_hook" 4372 return 1 4373 fi 4374 4375 #domain and authz map 4376 _authorizations_map="" 4377 for _authz_url in $(echo "$_authorizations_seg" | tr ',' ' '); do 4378 _debug2 "_authz_url" "$_authz_url" 4379 if ! _send_signed_request "$_authz_url"; then 4380 _err "get to authz error." 4381 _err "_authorizations_seg" "$_authorizations_seg" 4382 _err "_authz_url" "$_authz_url" 4181 if [ "$ACME_VERSION" = "2" ]; then 4182 #make new order request 4183 _identifiers="{\"type\":\"dns\",\"value\":\"$(_idn "$_main_domain")\"}" 4184 _w_index=1 4185 while true; do 4186 d="$(echo "$_alt_domains," | cut -d , -f "$_w_index")" 4187 _w_index="$(_math "$_w_index" + 1)" 4188 _debug d "$d" 4189 if [ -z "$d" ]; then 4190 break 4191 fi 4192 _identifiers="$_identifiers,{\"type\":\"dns\",\"value\":\"$(_idn "$d")\"}" 4193 done 4194 _debug2 _identifiers "$_identifiers" 4195 if ! _send_signed_request "$ACME_NEW_ORDER" "{\"identifiers\": [$_identifiers]}"; then 4196 _err "Create new order error." 4383 4197 _clearup 4384 4198 _on_issue_err "$_post_hook" 4385 4199 return 1 4386 4200 fi 4387 4388 response="$(echo "$response" | _normalizeJson)" 4389 _debug2 response "$response" 4390 _d="$(echo "$response" | _egrep_o '"value" *: *"[^"]*"' | cut -d : -f 2 | tr -d ' "')" 4391 if _contains "$response" "\"wildcard\" *: *true"; then 4392 _d="*.$_d" 4393 fi 4394 _debug2 _d "$_d" 4395 _authorizations_map="$_d,$response 4201 Le_LinkOrder="$(echo "$responseHeaders" | grep -i '^Location.*$' | _tail_n 1 | tr -d "\r\n " | cut -d ":" -f 2-)" 4202 _debug Le_LinkOrder "$Le_LinkOrder" 4203 Le_OrderFinalize="$(echo "$response" | _egrep_o '"finalize" *: *"[^"]*"' | cut -d '"' -f 4)" 4204 _debug Le_OrderFinalize "$Le_OrderFinalize" 4205 if [ -z "$Le_OrderFinalize" ]; then 4206 _err "Create new order error. Le_OrderFinalize not found. $response" 4207 _clearup 4208 _on_issue_err "$_post_hook" 4209 return 1 4210 fi 4211 4212 #for dns manual mode 4213 _savedomainconf "Le_OrderFinalize" "$Le_OrderFinalize" 4214 4215 _authorizations_seg="$(echo "$response" | _json_decode | _egrep_o '"authorizations" *: *\[[^\[]*\]' | cut -d '[' -f 2 | tr -d ']' | tr -d '"')" 4216 _debug2 _authorizations_seg "$_authorizations_seg" 4217 if [ -z "$_authorizations_seg" ]; then 4218 _err "_authorizations_seg not found." 4219 _clearup 4220 _on_issue_err "$_post_hook" 4221 return 1 4222 fi 4223 4224 #domain and authz map 4225 _authorizations_map="" 4226 for _authz_url in $(echo "$_authorizations_seg" | tr ',' ' '); do 4227 _debug2 "_authz_url" "$_authz_url" 4228 if ! _send_signed_request "$_authz_url"; then 4229 _err "get to authz error." 4230 _err "_authorizations_seg" "$_authorizations_seg" 4231 _err "_authz_url" "$_authz_url" 4232 _clearup 4233 _on_issue_err "$_post_hook" 4234 return 1 4235 fi 4236 4237 response="$(echo "$response" | _normalizeJson)" 4238 _debug2 response "$response" 4239 _d="$(echo "$response" | _egrep_o '"value" *: *"[^"]*"' | cut -d : -f 2 | tr -d ' "')" 4240 if _contains "$response" "\"wildcard\" *: *true"; then 4241 _d="*.$_d" 4242 fi 4243 _debug2 _d "$_d" 4244 _authorizations_map="$_d,$response 4396 4245 $_authorizations_map" 4397 done 4398 _debug2 _authorizations_map "$_authorizations_map" 4246 done 4247 _debug2 _authorizations_map "$_authorizations_map" 4248 fi 4399 4249 4400 4250 _index=0 … … 4427 4277 fi 4428 4278 4429 _idn_d="$(_idn "$d")" 4430 _candidates="$(echo "$_authorizations_map" | grep -i "^$_idn_d,")" 4431 _debug2 _candidates "$_candidates" 4432 if [ "$(echo "$_candidates" | wc -l)" -gt 1 ]; then 4433 for _can in $_candidates; do 4434 if _startswith "$(echo "$_can" | tr '.' '|')" "$(echo "$_idn_d" | tr '.' '|'),"; then 4435 _candidates="$_can" 4436 break 4437 fi 4438 done 4439 fi 4440 response="$(echo "$_candidates" | sed "s/$_idn_d,//")" 4441 _debug2 "response" "$response" 4442 if [ -z "$response" ]; then 4443 _err "get to authz error." 4444 _err "_authorizations_map" "$_authorizations_map" 4445 _clearup 4446 _on_issue_err "$_post_hook" 4447 return 1 4279 if [ "$ACME_VERSION" = "2" ]; then 4280 _idn_d="$(_idn "$d")" 4281 _candidates="$(echo "$_authorizations_map" | grep -i "^$_idn_d,")" 4282 _debug2 _candidates "$_candidates" 4283 if [ "$(echo "$_candidates" | wc -l)" -gt 1 ]; then 4284 for _can in $_candidates; do 4285 if _startswith "$(echo "$_can" | tr '.' '|')" "$(echo "$_idn_d" | tr '.' '|'),"; then 4286 _candidates="$_can" 4287 break 4288 fi 4289 done 4290 fi 4291 response="$(echo "$_candidates" | sed "s/$_idn_d,//")" 4292 _debug2 "response" "$response" 4293 if [ -z "$response" ]; then 4294 _err "get to authz error." 4295 _err "_authorizations_map" "$_authorizations_map" 4296 _clearup 4297 _on_issue_err "$_post_hook" 4298 return 1 4299 fi 4300 else 4301 if ! __get_domain_new_authz "$d"; then 4302 _clearup 4303 _on_issue_err "$_post_hook" 4304 return 1 4305 fi 4448 4306 fi 4449 4307 … … 4486 4344 return 1 4487 4345 fi 4488 4489 uri="$(echo "$entry" | _egrep_o '"url":"[^"]*' | cut -d '"' -f 4 | _head_n 1)" 4490 4346 if [ "$ACME_VERSION" = "2" ]; then 4347 uri="$(echo "$entry" | _egrep_o '"url":"[^"]*' | cut -d '"' -f 4 | _head_n 1)" 4348 else 4349 uri="$(echo "$entry" | _egrep_o '"uri":"[^"]*' | cut -d '"' -f 4)" 4350 fi 4491 4351 _debug uri "$uri" 4492 4352 … … 4783 4643 fi 4784 4644 4645 _debug "sleep 2 secs to verify" 4646 sleep 2 4647 _debug "checking" 4648 if [ "$ACME_VERSION" = "2" ]; then 4649 _send_signed_request "$uri" 4650 else 4651 response="$(_get "$uri")" 4652 fi 4653 if [ "$?" != "0" ]; then 4654 _err "$d:Verify error:$response" 4655 _clearupwebbroot "$_currentRoot" "$removelevel" "$token" 4656 _clearup 4657 _on_issue_err "$_post_hook" "$vlist" 4658 return 1 4659 fi 4785 4660 _debug2 original "$response" 4786 4661 … … 4789 4664 4790 4665 status=$(echo "$response" | _egrep_o '"status":"[^"]*' | cut -d : -f 2 | tr -d '"') 4791 _debug2 status "$status" 4792 if _contains "$status" "invalid"; then 4666 if [ "$status" = "valid" ]; then 4667 _info "$(__green Success)" 4668 _stopserver "$serverproc" 4669 serverproc="" 4670 _clearupwebbroot "$_currentRoot" "$removelevel" "$token" 4671 break 4672 fi 4673 4674 if [ "$status" = "invalid" ]; then 4793 4675 error="$(echo "$response" | _egrep_o '"error":\{[^\}]*')" 4794 4676 _debug2 error "$error" … … 4812 4694 fi 4813 4695 4814 if _contains "$status" "valid"; then4815 _info "$(__green Success)"4816 _stopserver "$serverproc"4817 serverproc=""4818 _clearupwebbroot "$_currentRoot" "$removelevel" "$token"4819 break4820 fi4821 4822 4696 if [ "$status" = "pending" ]; then 4823 _info "Pending , The CA is processing your order, please just wait. ($waittimes/$MAX_RETRY_TIMES)"4697 _info "Pending" 4824 4698 elif [ "$status" = "processing" ]; then 4825 _info "Processing , The CA is processing your order, please just wait. ($waittimes/$MAX_RETRY_TIMES)"4699 _info "Processing" 4826 4700 else 4827 4701 _err "$d:Verify error:$response" … … 4831 4705 return 1 4832 4706 fi 4833 _debug "sleep 2 secs to verify again" 4834 sleep 2 4835 _debug "checking" 4836 4837 _send_signed_request "$uri" 4838 4839 if [ "$?" != "0" ]; then 4840 _err "$d:Verify error:$response" 4841 _clearupwebbroot "$_currentRoot" "$removelevel" "$token" 4842 _clearup 4843 _on_issue_err "$_post_hook" "$vlist" 4844 return 1 4845 fi 4707 4846 4708 done 4847 4709 … … 4852 4714 der="$(_getfile "${CSR_PATH}" "${BEGIN_CSR}" "${END_CSR}" | tr -d "\r\n" | _url_replace)" 4853 4715 4854 _info "Lets finalize the order." 4855 _info "Le_OrderFinalize" "$Le_OrderFinalize" 4856 if ! _send_signed_request "${Le_OrderFinalize}" "{\"csr\": \"$der\"}"; then 4857 _err "Sign failed." 4858 _on_issue_err "$_post_hook" 4859 return 1 4860 fi 4861 if [ "$code" != "200" ]; then 4862 _err "Sign failed, finalize code is not 200." 4863 _err "$response" 4864 _on_issue_err "$_post_hook" 4865 return 1 4866 fi 4867 if [ -z "$Le_LinkOrder" ]; then 4868 Le_LinkOrder="$(echo "$responseHeaders" | grep -i '^Location.*$' | _tail_n 1 | tr -d "\r\n \t" | cut -d ":" -f 2-)" 4869 fi 4870 4871 _savedomainconf "Le_LinkOrder" "$Le_LinkOrder" 4872 4873 _link_cert_retry=0 4874 _MAX_CERT_RETRY=30 4875 while [ "$_link_cert_retry" -lt "$_MAX_CERT_RETRY" ]; do 4876 if _contains "$response" "\"status\":\"valid\""; then 4877 _debug "Order status is valid." 4878 Le_LinkCert="$(echo "$response" | _egrep_o '"certificate" *: *"[^"]*"' | cut -d '"' -f 4)" 4879 _debug Le_LinkCert "$Le_LinkCert" 4880 if [ -z "$Le_LinkCert" ]; then 4881 _err "Sign error, can not find Le_LinkCert" 4716 if [ "$ACME_VERSION" = "2" ]; then 4717 _info "Lets finalize the order." 4718 _info "Le_OrderFinalize" "$Le_OrderFinalize" 4719 if ! _send_signed_request "${Le_OrderFinalize}" "{\"csr\": \"$der\"}"; then 4720 _err "Sign failed." 4721 _on_issue_err "$_post_hook" 4722 return 1 4723 fi 4724 if [ "$code" != "200" ]; then 4725 _err "Sign failed, finalize code is not 200." 4726 _err "$response" 4727 _on_issue_err "$_post_hook" 4728 return 1 4729 fi 4730 if [ -z "$Le_LinkOrder" ]; then 4731 Le_LinkOrder="$(echo "$responseHeaders" | grep -i '^Location.*$' | _tail_n 1 | tr -d "\r\n \t" | cut -d ":" -f 2-)" 4732 fi 4733 4734 _savedomainconf "Le_LinkOrder" "$Le_LinkOrder" 4735 4736 _link_cert_retry=0 4737 _MAX_CERT_RETRY=30 4738 while [ "$_link_cert_retry" -lt "$_MAX_CERT_RETRY" ]; do 4739 if _contains "$response" "\"status\":\"valid\""; then 4740 _debug "Order status is valid." 4741 Le_LinkCert="$(echo "$response" | _egrep_o '"certificate" *: *"[^"]*"' | cut -d '"' -f 4)" 4742 _debug Le_LinkCert "$Le_LinkCert" 4743 if [ -z "$Le_LinkCert" ]; then 4744 _err "Sign error, can not find Le_LinkCert" 4745 _err "$response" 4746 _on_issue_err "$_post_hook" 4747 return 1 4748 fi 4749 break 4750 elif _contains "$response" "\"processing\""; then 4751 _info "Order status is processing, lets sleep and retry." 4752 _retryafter=$(echo "$responseHeaders" | grep -i "^Retry-After *:" | cut -d : -f 2 | tr -d ' ' | tr -d '\r') 4753 _debug "_retryafter" "$_retryafter" 4754 if [ "$_retryafter" ]; then 4755 _info "Retry after: $_retryafter" 4756 _sleep $_retryafter 4757 else 4758 _sleep 2 4759 fi 4760 else 4761 _err "Sign error, wrong status" 4882 4762 _err "$response" 4883 4763 _on_issue_err "$_post_hook" 4884 4764 return 1 4885 4765 fi 4886 break 4887 elif _contains "$response" "\"processing\""; then 4888 _info "Order status is processing, lets sleep and retry." 4889 _retryafter=$(echo "$responseHeaders" | grep -i "^Retry-After *:" | cut -d : -f 2 | tr -d ' ' | tr -d '\r') 4890 _debug "_retryafter" "$_retryafter" 4891 if [ "$_retryafter" ]; then 4892 _info "Retry after: $_retryafter" 4893 _sleep $_retryafter 4894 else 4895 _sleep 2 4896 fi 4897 else 4898 _err "Sign error, wrong status" 4766 #the order is processing, so we are going to poll order status 4767 if [ -z "$Le_LinkOrder" ]; then 4768 _err "Sign error, can not get order link location header" 4769 _err "responseHeaders" "$responseHeaders" 4770 _on_issue_err "$_post_hook" 4771 return 1 4772 fi 4773 _info "Polling order status: $Le_LinkOrder" 4774 if ! _send_signed_request "$Le_LinkOrder"; then 4775 _err "Sign failed, can not post to Le_LinkOrder cert:$Le_LinkOrder." 4776 _err "$response" 4777 _on_issue_err "$_post_hook" 4778 return 1 4779 fi 4780 _link_cert_retry="$(_math $_link_cert_retry + 1)" 4781 done 4782 4783 if [ -z "$Le_LinkCert" ]; then 4784 _err "Sign failed, can not get Le_LinkCert, retry time limit." 4899 4785 _err "$response" 4900 4786 _on_issue_err "$_post_hook" 4901 4787 return 1 4902 4788 fi 4903 #the order is processing, so we are going to poll order status 4904 if [ -z "$Le_LinkOrder" ]; then 4905 _err "Sign error, can not get order link location header" 4906 _err "responseHeaders" "$responseHeaders" 4907 _on_issue_err "$_post_hook" 4908 return 1 4909 fi 4910 _info "Polling order status: $Le_LinkOrder" 4911 if ! _send_signed_request "$Le_LinkOrder"; then 4912 _err "Sign failed, can not post to Le_LinkOrder cert:$Le_LinkOrder." 4789 _info "Downloading cert." 4790 _info "Le_LinkCert" "$Le_LinkCert" 4791 if ! _send_signed_request "$Le_LinkCert"; then 4792 _err "Sign failed, can not download cert:$Le_LinkCert." 4913 4793 _err "$response" 4914 4794 _on_issue_err "$_post_hook" 4915 4795 return 1 4916 4796 fi 4917 _link_cert_retry="$(_math $_link_cert_retry + 1)" 4918 done 4919 4920 if [ -z "$Le_LinkCert" ]; then 4921 _err "Sign failed, can not get Le_LinkCert, retry time limit." 4922 _err "$response" 4923 _on_issue_err "$_post_hook" 4924 return 1 4925 fi 4926 _info "Downloading cert." 4927 _info "Le_LinkCert" "$Le_LinkCert" 4928 if ! _send_signed_request "$Le_LinkCert"; then 4929 _err "Sign failed, can not download cert:$Le_LinkCert." 4930 _err "$response" 4931 _on_issue_err "$_post_hook" 4932 return 1 4933 fi 4934 4935 echo "$response" >"$CERT_PATH" 4936 _split_cert_chain "$CERT_PATH" "$CERT_FULLCHAIN_PATH" "$CA_CERT_PATH" 4937 if [ -z "$_preferred_chain" ]; then 4938 _preferred_chain=$(_readcaconf DEFAULT_PREFERRED_CHAIN) 4939 fi 4940 if [ "$_preferred_chain" ] && [ -f "$CERT_FULLCHAIN_PATH" ]; then 4941 if [ "$DEBUG" ]; then 4942 _debug "default chain issuers: " "$(_get_chain_issuers "$CERT_FULLCHAIN_PATH")" 4943 fi 4944 if ! _match_issuer "$CERT_FULLCHAIN_PATH" "$_preferred_chain"; then 4945 rels="$(echo "$responseHeaders" | tr -d ' <>' | grep -i "^link:" | grep -i 'rel="alternate"' | cut -d : -f 2- | cut -d ';' -f 1)" 4946 _debug2 "rels" "$rels" 4947 for rel in $rels; do 4948 _info "Try rel: $rel" 4949 if ! _send_signed_request "$rel"; then 4950 _err "Sign failed, can not download cert:$rel" 4951 _err "$response" 4952 continue 4953 fi 4954 _relcert="$CERT_PATH.alt" 4955 _relfullchain="$CERT_FULLCHAIN_PATH.alt" 4956 _relca="$CA_CERT_PATH.alt" 4957 echo "$response" >"$_relcert" 4958 _split_cert_chain "$_relcert" "$_relfullchain" "$_relca" 4959 if [ "$DEBUG" ]; then 4960 _debug "rel chain issuers: " "$(_get_chain_issuers "$_relfullchain")" 4961 fi 4962 if _match_issuer "$_relfullchain" "$_preferred_chain"; then 4963 _info "Matched issuer in: $rel" 4964 cat $_relcert >"$CERT_PATH" 4965 cat $_relfullchain >"$CERT_FULLCHAIN_PATH" 4966 cat $_relca >"$CA_CERT_PATH" 4967 rm -f "$_relcert" 4968 rm -f "$_relfullchain" 4969 rm -f "$_relca" 4970 break 4971 fi 4972 rm -f "$_relcert" 4973 rm -f "$_relfullchain" 4974 rm -f "$_relca" 4975 done 4976 fi 4797 4798 echo "$response" >"$CERT_PATH" 4799 _split_cert_chain "$CERT_PATH" "$CERT_FULLCHAIN_PATH" "$CA_CERT_PATH" 4800 4801 if [ "$_preferred_chain" ] && [ -f "$CERT_FULLCHAIN_PATH" ]; then 4802 if ! _match_issuer "$CERT_FULLCHAIN_PATH" "$_preferred_chain"; then 4803 rels="$(echo "$responseHeaders" | tr -d ' <>' | grep -i "^link:" | grep -i 'rel="alternate"' | cut -d : -f 2- | cut -d ';' -f 1)" 4804 _debug2 "rels" "$rels" 4805 for rel in $rels; do 4806 _info "Try rel: $rel" 4807 if ! _send_signed_request "$rel"; then 4808 _err "Sign failed, can not download cert:$rel" 4809 _err "$response" 4810 continue 4811 fi 4812 _relcert="$CERT_PATH.alt" 4813 _relfullchain="$CERT_FULLCHAIN_PATH.alt" 4814 _relca="$CA_CERT_PATH.alt" 4815 echo "$response" >"$_relcert" 4816 _split_cert_chain "$_relcert" "$_relfullchain" "$_relca" 4817 if _match_issuer "$_relfullchain" "$_preferred_chain"; then 4818 _info "Matched issuer in: $rel" 4819 cat $_relcert >"$CERT_PATH" 4820 cat $_relfullchain >"$CERT_FULLCHAIN_PATH" 4821 cat $_relca >"$CA_CERT_PATH" 4822 break 4823 fi 4824 done 4825 fi 4826 fi 4827 else 4828 if ! _send_signed_request "${ACME_NEW_ORDER}" "{\"resource\": \"$ACME_NEW_ORDER_RES\", \"csr\": \"$der\"}" "needbase64"; then 4829 _err "Sign failed. $response" 4830 _on_issue_err "$_post_hook" 4831 return 1 4832 fi 4833 _rcert="$response" 4834 Le_LinkCert="$(grep -i '^Location.*$' "$HTTP_HEADER" | _tail_n 1 | tr -d "\r\n" | cut -d " " -f 2)" 4835 echo "$BEGIN_CERT" >"$CERT_PATH" 4836 4837 #if ! _get "$Le_LinkCert" | _base64 "multiline" >> "$CERT_PATH" ; then 4838 # _debug "Get cert failed. Let's try last response." 4839 # printf -- "%s" "$_rcert" | _dbase64 "multiline" | _base64 "multiline" >> "$CERT_PATH" 4840 #fi 4841 4842 if ! printf -- "%s" "$_rcert" | _dbase64 "multiline" | _base64 "multiline" >>"$CERT_PATH"; then 4843 _debug "Try cert link." 4844 _get "$Le_LinkCert" | _base64 "multiline" >>"$CERT_PATH" 4845 fi 4846 4847 echo "$END_CERT" >>"$CERT_PATH" 4977 4848 fi 4978 4849 … … 4991 4862 cat "$CERT_PATH" 4992 4863 4993 _info "Your cert is in : $(__green "$CERT_PATH")"4864 _info "Your cert is in $(__green " $CERT_PATH ")" 4994 4865 4995 4866 if [ -f "$CERT_KEY_PATH" ]; then 4996 _info "Your cert key is in : $(__green "$CERT_KEY_PATH")"4867 _info "Your cert key is in $(__green " $CERT_KEY_PATH ")" 4997 4868 fi 4998 4869 … … 5003 4874 fi 5004 4875 5005 [ -f "$CA_CERT_PATH" ] && _info "The intermediate CA cert is in: $(__green "$CA_CERT_PATH")" 5006 [ -f "$CERT_FULLCHAIN_PATH" ] && _info "And the full chain certs is there: $(__green "$CERT_FULLCHAIN_PATH")" 4876 if [ "$ACME_VERSION" = "2" ]; then 4877 _debug "v2 chain." 4878 else 4879 cp "$CERT_PATH" "$CERT_FULLCHAIN_PATH" 4880 Le_LinkIssuer=$(grep -i '^Link' "$HTTP_HEADER" | _head_n 1 | cut -d " " -f 2 | cut -d ';' -f 1 | tr -d '<>') 4881 4882 if [ "$Le_LinkIssuer" ]; then 4883 if ! _contains "$Le_LinkIssuer" ":"; then 4884 _info "$(__red "Relative issuer link found.")" 4885 Le_LinkIssuer="$_ACME_SERVER_HOST$Le_LinkIssuer" 4886 fi 4887 _debug Le_LinkIssuer "$Le_LinkIssuer" 4888 _savedomainconf "Le_LinkIssuer" "$Le_LinkIssuer" 4889 4890 _link_issuer_retry=0 4891 _MAX_ISSUER_RETRY=5 4892 while [ "$_link_issuer_retry" -lt "$_MAX_ISSUER_RETRY" ]; do 4893 _debug _link_issuer_retry "$_link_issuer_retry" 4894 if [ "$ACME_VERSION" = "2" ]; then 4895 if _send_signed_request "$Le_LinkIssuer"; then 4896 echo "$response" >"$CA_CERT_PATH" 4897 break 4898 fi 4899 else 4900 if _get "$Le_LinkIssuer" >"$CA_CERT_PATH.der"; then 4901 echo "$BEGIN_CERT" >"$CA_CERT_PATH" 4902 _base64 "multiline" <"$CA_CERT_PATH.der" >>"$CA_CERT_PATH" 4903 echo "$END_CERT" >>"$CA_CERT_PATH" 4904 if ! _checkcert "$CA_CERT_PATH"; then 4905 _err "Can not get the ca cert." 4906 break 4907 fi 4908 cat "$CA_CERT_PATH" >>"$CERT_FULLCHAIN_PATH" 4909 rm -f "$CA_CERT_PATH.der" 4910 break 4911 fi 4912 fi 4913 _link_issuer_retry=$(_math $_link_issuer_retry + 1) 4914 _sleep "$_link_issuer_retry" 4915 done 4916 if [ "$_link_issuer_retry" = "$_MAX_ISSUER_RETRY" ]; then 4917 _err "Max retry for issuer ca cert is reached." 4918 fi 4919 else 4920 _debug "No Le_LinkIssuer header found." 4921 fi 4922 fi 4923 [ -f "$CA_CERT_PATH" ] && _info "The intermediate CA cert is in $(__green " $CA_CERT_PATH ")" 4924 [ -f "$CERT_FULLCHAIN_PATH" ] && _info "And the full chain certs is there: $(__green " $CERT_FULLCHAIN_PATH ")" 5007 4925 5008 4926 Le_CertCreateTime=$(_time) … … 5115 5033 . "$DOMAIN_CONF" 5116 5034 _debug Le_API "$Le_API" 5117 if [ -z "$Le_API" ] || [ "$CA_LETSENCRYPT_V1" = "$Le_API" ]; then 5118 #if this is from an old version, Le_API is empty, 5119 #so, we force to use letsencrypt server 5120 Le_API="$CA_LETSENCRYPT_V2" 5035 5036 if [ "$Le_API" = "$LETSENCRYPT_CA_V1" ]; then 5037 _cleardomainconf Le_API 5038 Le_API="$DEFAULT_CA" 5039 fi 5040 if [ "$Le_API" = "$LETSENCRYPT_STAGING_CA_V1" ]; then 5041 _cleardomainconf Le_API 5042 Le_API="$DEFAULT_STAGING_CA" 5121 5043 fi 5122 5044 5123 5045 if [ "$Le_API" ]; then 5124 if [ "$Le_API" != "$ACME_DIRECTORY" ]; then5125 _clearAPI5126 fi5127 5046 export ACME_DIRECTORY="$Le_API" 5128 5047 #reload ca configs … … 5132 5051 _debug3 "initpath again." 5133 5052 _initpath "$Le_Domain" "$_isEcc" 5134 _initAPI5135 5053 fi 5136 5054 … … 5301 5219 _local_addr="${11}" 5302 5220 _challenge_alias="${12}" 5303 _preferred_chain="${13}"5304 5221 5305 5222 _csrsubj=$(_readSubjectFromCSR "$_csrfile") … … 5339 5256 fi 5340 5257 5258 if [ -z "$ACME_VERSION" ] && _contains "$_csrsubj,$_csrdomainlist" "*."; then 5259 export ACME_VERSION=2 5260 fi 5341 5261 _initpath "$_csrsubj" "$_csrkeylength" 5342 5262 mkdir -p "$DOMAIN_PATH" … … 5345 5265 cp "$_csrfile" "$CSR_PATH" 5346 5266 5347 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"5267 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" 5348 5268 5349 5269 } … … 5548 5468 5549 5469 if [ "$_real_cert" ]; then 5550 _info "Installing cert to: 5470 _info "Installing cert to:$_real_cert" 5551 5471 if [ -f "$_real_cert" ] && [ ! "$_ACME_IS_RENEW" ]; then 5552 5472 cp "$_real_cert" "$_backup_path/cert.bak" … … 5556 5476 5557 5477 if [ "$_real_ca" ]; then 5558 _info "Installing CA to: 5478 _info "Installing CA to:$_real_ca" 5559 5479 if [ "$_real_ca" = "$_real_cert" ]; then 5560 5480 echo "" >>"$_real_ca" … … 5569 5489 5570 5490 if [ "$_real_key" ]; then 5571 _info "Installing key to: 5491 _info "Installing key to:$_real_key" 5572 5492 if [ -f "$_real_key" ] && [ ! "$_ACME_IS_RENEW" ]; then 5573 5493 cp "$_real_key" "$_backup_path/key.bak" … … 5582 5502 5583 5503 if [ "$_real_fullchain" ]; then 5584 _info "Installing full chain to: 5504 _info "Installing full chain to:$_real_fullchain" 5585 5505 if [ -f "$_real_fullchain" ] && [ ! "$_ACME_IS_RENEW" ]; then 5586 5506 cp "$_real_fullchain" "$_backup_path/fullchain.bak" … … 5750 5670 cr="$($_CRONTAB -l | grep "$PROJECT_ENTRY --cron")" 5751 5671 if [ "$cr" ]; then 5752 if _exists uname && uname -a | grep SunOS>/dev/null; then5672 if _exists uname && uname -a | grep solaris >/dev/null; then 5753 5673 $_CRONTAB -l | sed "/$PROJECT_ENTRY --cron/d" | $_CRONTAB -- 5754 5674 else … … 5790 5710 fi 5791 5711 5792 . "$DOMAIN_CONF"5793 _debug Le_API "$Le_API"5794 5795 if [ "$Le_API" ]; then5796 if [ "$Le_API" != "$ACME_DIRECTORY" ]; then5797 _clearAPI5798 fi5799 export ACME_DIRECTORY="$Le_API"5800 #reload ca configs5801 ACCOUNT_KEY_PATH=""5802 ACCOUNT_JSON_PATH=""5803 CA_CONF=""5804 _debug3 "initpath again."5805 _initpath "$Le_Domain" "$_isEcc"5806 _initAPI5807 fi5808 5809 5712 cert="$(_getfile "${CERT_PATH}" "${BEGIN_CERT}" "${END_CERT}" | tr -d "\r\n" | _url_replace)" 5810 5713 … … 5816 5719 _initAPI 5817 5720 5818 data="{\"certificate\": \"$cert\",\"reason\":$_reason}" 5819 5721 if [ "$ACME_VERSION" = "2" ]; then 5722 data="{\"certificate\": \"$cert\",\"reason\":$_reason}" 5723 else 5724 data="{\"resource\": \"revoke-cert\", \"certificate\": \"$cert\"}" 5725 fi 5820 5726 uri="${ACME_REVOKE_CERT}" 5821 5727 … … 5886 5792 _d_domain="$1" 5887 5793 _d_type="$2" 5888 _initpath "$_d_domain" "$_d_type" 5889 5890 . "$DOMAIN_CONF" 5891 _debug Le_API "$Le_API" 5892 5893 if [ "$Le_API" ]; then 5894 if [ "$Le_API" != "$ACME_DIRECTORY" ]; then 5895 _clearAPI 5896 fi 5897 export ACME_DIRECTORY="$Le_API" 5898 #reload ca configs 5899 ACCOUNT_KEY_PATH="" 5900 ACCOUNT_JSON_PATH="" 5901 CA_CONF="" 5902 _debug3 "initpath again." 5903 _initpath "$Le_Domain" "$_d_type" 5904 _initAPI 5905 fi 5906 5907 _identifiers="{\"type\":\"dns\",\"value\":\"$_d_domain\"}" 5908 if ! _send_signed_request "$ACME_NEW_ORDER" "{\"identifiers\": [$_identifiers]}"; then 5909 _err "Can not get domain new order." 5910 return 1 5911 fi 5912 _authorizations_seg="$(echo "$response" | _egrep_o '"authorizations" *: *\[[^\]*\]' | cut -d '[' -f 2 | tr -d ']' | tr -d '"')" 5913 _debug2 _authorizations_seg "$_authorizations_seg" 5914 if [ -z "$_authorizations_seg" ]; then 5915 _err "_authorizations_seg not found." 5916 _clearup 5917 _on_issue_err "$_post_hook" 5918 return 1 5919 fi 5920 5921 authzUri="$_authorizations_seg" 5922 _debug2 "authzUri" "$authzUri" 5923 if ! _send_signed_request "$authzUri"; then 5924 _err "get to authz error." 5925 _err "_authorizations_seg" "$_authorizations_seg" 5926 _err "authzUri" "$authzUri" 5927 _clearup 5928 _on_issue_err "$_post_hook" 5929 return 1 5930 fi 5931 5932 response="$(echo "$response" | _normalizeJson)" 5933 _debug2 response "$response" 5934 _URL_NAME="url" 5935 5936 entries="$(echo "$response" | tr '][' '==' | _egrep_o "challenges\": *=[^=]*=" | tr '}{' '\n\n' | grep "\"status\": *\"valid\"")" 5794 _initpath 5795 5796 if [ "$ACME_VERSION" = "2" ]; then 5797 _identifiers="{\"type\":\"dns\",\"value\":\"$_d_domain\"}" 5798 if ! _send_signed_request "$ACME_NEW_ORDER" "{\"identifiers\": [$_identifiers]}"; then 5799 _err "Can not get domain new order." 5800 return 1 5801 fi 5802 _authorizations_seg="$(echo "$response" | _egrep_o '"authorizations" *: *\[[^\]*\]' | cut -d '[' -f 2 | tr -d ']' | tr -d '"')" 5803 _debug2 _authorizations_seg "$_authorizations_seg" 5804 if [ -z "$_authorizations_seg" ]; then 5805 _err "_authorizations_seg not found." 5806 _clearup 5807 _on_issue_err "$_post_hook" 5808 return 1 5809 fi 5810 5811 authzUri="$_authorizations_seg" 5812 _debug2 "authzUri" "$authzUri" 5813 if ! _send_signed_request "$authzUri"; then 5814 _err "get to authz error." 5815 _err "_authorizations_seg" "$_authorizations_seg" 5816 _err "authzUri" "$authzUri" 5817 _clearup 5818 _on_issue_err "$_post_hook" 5819 return 1 5820 fi 5821 5822 response="$(echo "$response" | _normalizeJson)" 5823 _debug2 response "$response" 5824 _URL_NAME="url" 5825 else 5826 if ! __get_domain_new_authz "$_d_domain"; then 5827 _err "Can not get domain new authz token." 5828 return 1 5829 fi 5830 5831 authzUri="$(echo "$responseHeaders" | grep "^Location:" | _head_n 1 | cut -d ':' -f 2- | tr -d "\r\n")" 5832 _debug "authzUri" "$authzUri" 5833 if [ "$code" ] && [ ! "$code" = '201' ]; then 5834 _err "new-authz error: $response" 5835 return 1 5836 fi 5837 _URL_NAME="uri" 5838 fi 5839 5840 entries="$(echo "$response" | tr '][' '==' | _egrep_o "challenges\": *=[^=]*=" | tr '}{' '\n' | grep "\"status\": *\"valid\"")" 5937 5841 if [ -z "$entries" ]; then 5938 5842 _info "No valid entries found." … … 5987 5891 _info "Deactivate: $_vtype" 5988 5892 5989 _djson="{\"status\":\"deactivated\"}" 5893 if [ "$ACME_VERSION" = "2" ]; then 5894 _djson="{\"status\":\"deactivated\"}" 5895 else 5896 _djson="{\"resource\": \"authz\", \"status\":\"deactivated\"}" 5897 fi 5990 5898 5991 5899 if _send_signed_request "$authzUri" "$_djson" && _contains "$response" '"deactivated"'; then … … 6194 6102 } 6195 6103 6196 # nocron confighome noprofile accountemail6104 # nocron confighome noprofile 6197 6105 install() { 6198 6106 … … 6204 6112 _c_home="$2" 6205 6113 _noprofile="$3" 6206 _accountemail="$4"6207 6208 6114 if ! _initpath; then 6209 6115 _err "Install failed." … … 6322 6228 done 6323 6229 fi 6324 fi6325 6326 if [ "$_accountemail" ]; then6327 _saveaccountconf "ACCOUNT_EMAIL" "$_accountemail"6328 6230 fi 6329 6231 … … 6550 6452 --set-default-ca Used with '--server', Set the default CA to use. 6551 6453 See: $_SERVER_WIKI 6552 --set-default-chain Set the default preferred chain for a CA.6553 See: $_PREFERRED_CHAIN_WIKI6554 6454 6555 6455 … … 6608 6508 --config-home <directory> Specifies the home dir to save all the configurations. 6609 6509 --useragent <string> Specifies the user agent string. it will be saved for future use too. 6610 -m, -- email <email>Specifies the account email, only valid for the '--install' and '--update-account' command.6510 -m, --accountemail <email> Specifies the account email, only valid for the '--install' and '--update-account' command. 6611 6511 --accountkey <file> Specifies the account key path, only valid for the '--install' command. 6612 6512 --days <ndays> Specifies the days to renew the cert when using '--issue' command. The default value is $DEFAULT_RENEW days. … … 6619 6519 --ca-bundle <file> Specifies the path to the CA certificate bundle to verify api server's certificate. 6620 6520 --ca-path <directory> Specifies directory containing CA certificates in PEM format, used by wget or curl. 6621 --no -cronOnly valid for '--install' command, which means: do not install the default cron job.6521 --nocron Only valid for '--install' command, which means: do not install the default cron job. 6622 6522 In this case, the certs will not be renewed automatically. 6623 --no -profileOnly valid for '--install' command, which means: do not install aliases to user profile.6523 --noprofile Only valid for '--install' command, which means: do not install aliases to user profile. 6624 6524 --no-color Do not output color text. 6625 6525 --force-color Force output of color text. Useful for non-interactive use with the aha tool for HTML E-Mails. … … 6659 6559 } 6660 6560 6661 installOnline() { 6561 # nocron noprofile 6562 _installOnline() { 6662 6563 _info "Installing from online archive." 6663 6664 _ branch="$BRANCH"6665 if [ -z "$_branch" ]; then6666 _branch="master"6667 fi 6668 6669 target="$PROJECT/archive/$ _branch.tar.gz"6564 _nocron="$1" 6565 _noprofile="$2" 6566 if [ ! "$BRANCH" ]; then 6567 BRANCH="master" 6568 fi 6569 6570 target="$PROJECT/archive/$BRANCH.tar.gz" 6670 6571 _info "Downloading $target" 6671 localname="$ _branch.tar.gz"6572 localname="$BRANCH.tar.gz" 6672 6573 if ! _get "$target" >$localname; then 6673 6574 _err "Download error." … … 6681 6582 fi 6682 6583 6683 cd "$PROJECT_NAME-$ _branch"6584 cd "$PROJECT_NAME-$BRANCH" 6684 6585 chmod +x $PROJECT_ENTRY 6685 if ./$PROJECT_ENTRY --install "$@"; then6586 if ./$PROJECT_ENTRY install "$_nocron" "" "$_noprofile"; then 6686 6587 _info "Install success!" 6687 6588 _initpath … … 6691 6592 cd .. 6692 6593 6693 rm -rf "$PROJECT_NAME-$ _branch"6594 rm -rf "$PROJECT_NAME-$BRANCH" 6694 6595 rm -f "$localname" 6695 6596 ) … … 6700 6601 shift 6701 6602 _hash_url="https://api.github.com/repos/acmesh-official/$PROJECT_NAME/git/refs/$_hash_path" 6702 _get $_hash_url | tr -d "\r\n" | tr '{},' '\n \n\n' | grep '"sha":' | cut -d '"' -f 46603 _get $_hash_url | tr -d "\r\n" | tr '{},' '\n' | grep '"sha":' | cut -d '"' -f 4 6703 6604 } 6704 6605 … … 6719 6620 export LE_WORKING_DIR 6720 6621 cd "$LE_WORKING_DIR" 6721 installOnline "--nocron" "--noprofile"6622 _installOnline "nocron" "noprofile" 6722 6623 ); then 6723 6624 _info "Upgrade success!" … … 6773 6674 } 6774 6675 6775 #server #keylength6676 #server 6776 6677 _selectServer() { 6777 6678 _server="$1" 6778 _skeylength="$2"6779 6679 _server_lower="$(echo "$_server" | _lower_case)" 6780 6680 _sindex=0 … … 6787 6687 _debug2 "_selectServer match $sname" 6788 6688 _serverdir="$(_getfield "$CA_SERVERS" $_sindex)" 6789 if [ "$_serverdir" = "$CA_SSLCOM_RSA" ] && _isEccKey "$_skeylength"; then6790 _serverdir="$CA_SSLCOM_ECC"6791 fi6792 6689 _debug "Selected server: $_serverdir" 6793 6690 ACME_DIRECTORY="$_serverdir" … … 6806 6703 if [ -z "$caurl" ]; then 6807 6704 caurl="$DEFAULT_CA" 6808 fi6809 if [ "$CA_SSLCOM_ECC" = "$caurl" ]; then6810 caurl="$CA_SSLCOM_RSA" #just hack to get the short name6811 6705 fi 6812 6706 caurl_lower="$(echo $caurl | _lower_case)" … … 6836 6730 _saveaccountconf "DEFAULT_ACME_SERVER" "$ACME_DIRECTORY" 6837 6731 _info "Changed default CA to: $(__green "$ACME_DIRECTORY")" 6838 }6839 6840 #preferred-chain6841 setdefaultchain() {6842 _initpath6843 _preferred_chain="$1"6844 if [ -z "$_preferred_chain" ]; then6845 _err "Please give a '--preferred-chain value' value."6846 return 16847 fi6848 mkdir -p "$CA_DIR"6849 _savecaconf "DEFAULT_PREFERRED_CHAIN" "$_preferred_chain"6850 6732 } 6851 6733 … … 6918 6800 _CMD="install" 6919 6801 ;; 6920 --install-online)6921 shift6922 installOnline "$@"6923 return6924 ;;6925 6802 --uninstall) 6926 6803 _CMD="uninstall" … … 7000 6877 --set-default-ca) 7001 6878 _CMD="setdefaultca" 7002 ;;7003 --set-default-chain)7004 _CMD="setdefaultchain"7005 6879 ;; 7006 6880 -d | --domain) … … 7017 6891 fi 7018 6892 6893 if _startswith "$_dvalue" "*."; then 6894 _debug "Wildcard domain" 6895 export ACME_VERSION=2 6896 fi 7019 6897 if [ -z "$_domain" ]; then 7020 6898 _domain="$_dvalue" … … 7039 6917 --server) 7040 6918 _server="$2" 6919 _selectServer "$_server" 7041 6920 shift 7042 6921 ;; … … 7137 7016 shift 7138 7017 ;; 7018 7139 7019 --keylength | -k) 7140 7020 _keylength="$2" … … 7145 7025 shift 7146 7026 ;; 7027 7147 7028 --cert-file | --certpath) 7148 7029 _cert_file="$2" … … 7193 7074 shift 7194 7075 ;; 7195 -m | -- email | --accountemail)7076 -m | --accountemail) 7196 7077 _accountemail="$2" 7197 exportACCOUNT_EMAIL="$_accountemail"7078 ACCOUNT_EMAIL="$_accountemail" 7198 7079 shift 7199 7080 ;; … … 7238 7119 shift 7239 7120 ;; 7240 --no -cron | --nocron)7121 --nocron) 7241 7122 _nocron="1" 7242 7123 ;; 7243 --no -profile | --noprofile)7124 --noprofile) 7244 7125 _noprofile="1" 7245 7126 ;; … … 7407 7288 shift 1 7408 7289 done 7409 7410 if [ "$_server" ]; then7411 _selectServer "$_server" "${_ecc:-$_keylength}"7412 fi7413 7290 7414 7291 if [ "${_CMD}" != "install" ]; then … … 7465 7342 _debug "Running cmd: ${_CMD}" 7466 7343 case "${_CMD}" in 7467 install) install "$_nocron" "$_confighome" "$_noprofile" "$_accountemail";;7344 install) install "$_nocron" "$_confighome" "$_noprofile" ;; 7468 7345 uninstall) uninstall "$_nocron" ;; 7469 7346 upgrade) upgrade ;; … … 7475 7352 ;; 7476 7353 signcsr) 7477 signcsr "$_csr" "$_webroot" "$_cert_file" "$_key_file" "$_ca_file" "$_reloadcmd" "$_fullchain_file" "$_pre_hook" "$_post_hook" "$_renew_hook" "$_local_address" "$_challenge_alias" "$_preferred_chain"7354 signcsr "$_csr" "$_webroot" "$_cert_file" "$_key_file" "$_ca_file" "$_reloadcmd" "$_fullchain_file" "$_pre_hook" "$_post_hook" "$_renew_hook" "$_local_address" "$_challenge_alias" 7478 7355 ;; 7479 7356 showcsr) … … 7534 7411 setdefaultca 7535 7412 ;; 7536 setdefaultchain)7537 setdefaultchain "$_preferred_chain"7538 ;;7539 7413 *) 7540 7414 if [ "$_CMD" ]; then … … 7581 7455 } 7582 7456 7457 if [ "$INSTALLONLINE" ]; then 7458 INSTALLONLINE="" 7459 _installOnline 7460 exit 7461 fi 7462 7583 7463 main() { 7584 7464 [ -z "$1" ] && showhelp && return -
npl/syn3/acme/root/usr/bin/syn3-acme-issue
r3daa803 r79f7e49 15 15 16 16 if [ "$EXIT" == "0" ]; then 17 cat /usr/webint/ssl/server.crt /usr/webint/ssl/server. pem> /usr/webint/ssl/certandkey.pem17 cat /usr/webint/ssl/server.crt /usr/webint/ssl/server.key > /usr/webint/ssl/certandkey.pem 18 18 syn3-state certbot OK "SSL certificate valid." 19 19 fi -
npl/syn3/acme/root/usr/bin/syn3-acme-renew
r3daa803 r79f7e49 15 15 16 16 if [ "$EXIT" == "0" ]; then 17 cat /usr/webint/ssl/server.crt /usr/webint/ssl/server. pem> /usr/webint/ssl/certandkey.pem17 cat /usr/webint/ssl/server.crt /usr/webint/ssl/server.key > /usr/webint/ssl/certandkey.pem 18 18 syn3-state certbot OK "SSL certificate valid. `cat $STATUS`" 19 19 else -
npl/syn3/acme/syn3_acme.build
r3daa803 r79f7e49 1 1 21 10 -
npl/syn3/acme/syn3_acme.md5
r3daa803 r79f7e49 1 1 d41d8cd98f00b204e9800998ecf8427e ./root/etc/webint/SSL_DOMAINS.new 2 41f48d3c2742cbbdf0fe9b7bf77740c0./root/usr/bin/acme.sh2 0418c2dac1c09a1e0a5a923de7155251 ./root/usr/bin/acme.sh 3 3 a0e5403f61c08e4eda04cd2e61d7938a ./root/usr/bin/syn3-acme 4 a6acd24402cd102ba0fa6698140dc0b2 ./root/usr/bin/syn3-acme-issue5 4a90cca626fec2de3d266c94c0e7d321./root/usr/bin/syn3-acme-renew6 8bf81f0d178c08b77421b11d71fcf347./syn3_acme.pkg4 59aa594e0d86791b3aa9b7b1a3e88e42 ./root/usr/bin/syn3-acme-issue 5 917bbc278f45bd8ab36a946d4898dd0f ./root/usr/bin/syn3-acme-renew 6 0301b5ee1cb78f1410fe47edbf32e780 ./syn3_acme.pkg 7 7 1a66f2a0cb707f264b0268ee3d4956d3 ./syn3_acme.SlackBuild 8 33724e469f08288ccd67b04f39cae180./syn3_acme.SlackBuild.log.gz8 6c17d788610977961a07f821dad6ccc3 ./syn3_acme.SlackBuild.log.gz
Note: See TracChangeset
for help on using the changeset viewer.