mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-12-24 12:14:23 +08:00
Merge pull request #6582 from Roy-Orbison/request-ip-family
Choose an IP address family for outgoing requests
This commit is contained in:
40
acme.sh
40
acme.sh
@@ -1897,6 +1897,11 @@ _inithttp() {
|
||||
|
||||
if [ -z "$_ACME_CURL" ] && _exists "curl"; then
|
||||
_ACME_CURL="curl --silent --dump-header $HTTP_HEADER "
|
||||
if [ "$ACME_USE_IPV6_REQUESTS" ]; then
|
||||
_ACME_CURL="$_ACME_CURL --ipv6 "
|
||||
elif [ "$ACME_USE_IPV4_REQUESTS" ]; then
|
||||
_ACME_CURL="$_ACME_CURL --ipv4 "
|
||||
fi
|
||||
if [ -z "$ACME_HTTP_NO_REDIRECTS" ]; then
|
||||
_ACME_CURL="$_ACME_CURL -L "
|
||||
fi
|
||||
@@ -1924,6 +1929,11 @@ _inithttp() {
|
||||
|
||||
if [ -z "$_ACME_WGET" ] && _exists "wget"; then
|
||||
_ACME_WGET="wget -q"
|
||||
if [ "$ACME_USE_IPV6_REQUESTS" ]; then
|
||||
_ACME_WGET="$_ACME_WGET --inet6-only "
|
||||
elif [ "$ACME_USE_IPV4_REQUESTS" ]; then
|
||||
_ACME_WGET="$_ACME_WGET --inet4-only "
|
||||
fi
|
||||
if [ "$ACME_HTTP_NO_REDIRECTS" ]; then
|
||||
_ACME_WGET="$_ACME_WGET --max-redirect 0 "
|
||||
fi
|
||||
@@ -7076,6 +7086,8 @@ Parameters:
|
||||
--alpn Use standalone alpn mode.
|
||||
--stateless Use stateless mode.
|
||||
See: $_STATELESS_WIKI
|
||||
--request-v4 Force client requests to use ipv4.
|
||||
--request-v6 Force client requests to use ipv6.
|
||||
|
||||
--apache Use Apache mode.
|
||||
--dns [dns_hook] Use dns manual mode or dns api. Defaults to manual mode when argument is omitted.
|
||||
@@ -7255,6 +7267,20 @@ _processAccountConf() {
|
||||
_saveaccountconf "ACME_USE_WGET" "$ACME_USE_WGET"
|
||||
fi
|
||||
|
||||
if [ "$_request_v6" ]; then
|
||||
_saveaccountconf "ACME_USE_IPV6_REQUESTS" "$_request_v6"
|
||||
_clearaccountconf "ACME_USE_IPV4_REQUESTS"
|
||||
elif [ "$ACME_USE_IPV6_REQUESTS" ]; then
|
||||
_saveaccountconf "ACME_USE_IPV6_REQUESTS" "$ACME_USE_IPV6_REQUESTS"
|
||||
_clearaccountconf "ACME_USE_IPV4_REQUESTS"
|
||||
elif [ "$_request_v4" ]; then
|
||||
_saveaccountconf "ACME_USE_IPV4_REQUESTS" "$_request_v4"
|
||||
_clearaccountconf "ACME_USE_IPV6_REQUESTS"
|
||||
elif [ "$ACME_USE_IPV4_REQUESTS" ]; then
|
||||
_saveaccountconf "ACME_USE_IPV4_REQUESTS" "$ACME_USE_IPV4_REQUESTS"
|
||||
_clearaccountconf "ACME_USE_IPV6_REQUESTS"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
_checkSudo() {
|
||||
@@ -7420,6 +7446,8 @@ _process() {
|
||||
_local_address=""
|
||||
_log_level=""
|
||||
_auto_upgrade=""
|
||||
_request_v4=""
|
||||
_request_v6=""
|
||||
_listen_v4=""
|
||||
_listen_v6=""
|
||||
_openssl_bin=""
|
||||
@@ -7885,6 +7913,18 @@ _process() {
|
||||
fi
|
||||
AUTO_UPGRADE="$_auto_upgrade"
|
||||
;;
|
||||
--request-v4)
|
||||
_request_v4="1"
|
||||
ACME_USE_IPV4_REQUESTS="1"
|
||||
_request_v6=""
|
||||
ACME_USE_IPV6_REQUESTS=""
|
||||
;;
|
||||
--request-v6)
|
||||
_request_v6="1"
|
||||
ACME_USE_IPV6_REQUESTS="1"
|
||||
_request_v4=""
|
||||
ACME_USE_IPV4_REQUESTS=""
|
||||
;;
|
||||
--listen-v4)
|
||||
_listen_v4="1"
|
||||
Le_Listen_V4="$_listen_v4"
|
||||
|
||||
Reference in New Issue
Block a user