From: Andreas Thienemann Date: Sun, 28 May 2017 17:06:04 +0000 (+0200) Subject: Ability to provide extra curl options X-Git-Tag: v0.5.0~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd57777c6206ce991739b2681d09fee2b55b4afe;p=thirdparty%2Fdehydrated.git 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. --- diff --git a/dehydrated b/dehydrated index bfe5199..c731a0e 100755 --- a/dehydrated +++ b/dehydrated @@ -111,6 +111,7 @@ load_config() { ACCOUNTDIR= CHALLENGETYPE="http-01" CONFIG_D= + CURL_OPTS= DOMAINS_D= DOMAINS_TXT= HOOK= @@ -381,13 +382,13 @@ http_request() { set +e 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="${?}" 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="${?}" 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="${?}" else set -e diff --git a/docs/examples/config b/docs/examples/config index 2183f3b..69cd724 100644 --- a/docs/examples/config +++ b/docs/examples/config @@ -54,6 +54,9 @@ # Path to openssl config file (default: - tries to figure out system default) #OPENSSL_CNF= +# Extra options passed to the curl binary (default: ) +#CURL_OPTS= + # Program or function called in certain situations # # After generating the challenge-response, or after failed challenge (in this case altname is empty)