mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-04-20 15:31:21 +02:00
Ability to provide extra curl options
In some situations it might be necessary to pass extra commands to the curl binary, e.g. proxy authentication credentials. Adds the CURL_OPTS config option.
This commit is contained in:
committed by
Lukas Schauer
parent
ba31a505d2
commit
bd57777c62
@@ -111,6 +111,7 @@ load_config() {
|
|||||||
ACCOUNTDIR=
|
ACCOUNTDIR=
|
||||||
CHALLENGETYPE="http-01"
|
CHALLENGETYPE="http-01"
|
||||||
CONFIG_D=
|
CONFIG_D=
|
||||||
|
CURL_OPTS=
|
||||||
DOMAINS_D=
|
DOMAINS_D=
|
||||||
DOMAINS_TXT=
|
DOMAINS_TXT=
|
||||||
HOOK=
|
HOOK=
|
||||||
@@ -381,13 +382,13 @@ http_request() {
|
|||||||
|
|
||||||
set +e
|
set +e
|
||||||
if [[ "${1}" = "head" ]]; then
|
if [[ "${1}" = "head" ]]; then
|
||||||
statuscode="$(curl ${ip_version:-} -s -w "%{http_code}" -o "${tempcont}" "${2}" -I)"
|
statuscode="$(curl ${ip_version:-} ${CURL_OPTS} -s -w "%{http_code}" -o "${tempcont}" "${2}" -I)"
|
||||||
curlret="${?}"
|
curlret="${?}"
|
||||||
elif [[ "${1}" = "get" ]]; then
|
elif [[ "${1}" = "get" ]]; then
|
||||||
statuscode="$(curl ${ip_version:-} -s -w "%{http_code}" -o "${tempcont}" "${2}")"
|
statuscode="$(curl ${ip_version:-} ${CURL_OPTS} -s -w "%{http_code}" -o "${tempcont}" "${2}")"
|
||||||
curlret="${?}"
|
curlret="${?}"
|
||||||
elif [[ "${1}" = "post" ]]; then
|
elif [[ "${1}" = "post" ]]; then
|
||||||
statuscode="$(curl ${ip_version:-} -s -w "%{http_code}" -o "${tempcont}" "${2}" -d "${3}")"
|
statuscode="$(curl ${ip_version:-} ${CURL_OPTS} -s -w "%{http_code}" -o "${tempcont}" "${2}" -d "${3}")"
|
||||||
curlret="${?}"
|
curlret="${?}"
|
||||||
else
|
else
|
||||||
set -e
|
set -e
|
||||||
|
|||||||
@@ -54,6 +54,9 @@
|
|||||||
# Path to openssl config file (default: <unset> - tries to figure out system default)
|
# Path to openssl config file (default: <unset> - tries to figure out system default)
|
||||||
#OPENSSL_CNF=
|
#OPENSSL_CNF=
|
||||||
|
|
||||||
|
# Extra options passed to the curl binary (default: <unset>)
|
||||||
|
#CURL_OPTS=
|
||||||
|
|
||||||
# Program or function called in certain situations
|
# Program or function called in certain situations
|
||||||
#
|
#
|
||||||
# After generating the challenge-response, or after failed challenge (in this case altname is empty)
|
# After generating the challenge-response, or after failed challenge (in this case altname is empty)
|
||||||
|
|||||||
Reference in New Issue
Block a user