]> git.ipfire.org Git - thirdparty/dehydrated.git/commitdiff
Ability to provide extra curl options
authorAndreas Thienemann <athienem@cisco.com>
Sun, 28 May 2017 17:06:04 +0000 (19:06 +0200)
committerLukas Schauer <lukas@schauer.so>
Mon, 10 Jul 2017 14:44:39 +0000 (16:44 +0200)
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.

dehydrated
docs/examples/config

index bfe51996e8cbd224db21049c2dcc976518d5434d..c731a0eb346f7c3bbdb292782598d243c2c68661 100755 (executable)
@@ -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
index 2183f3bba1223924dd2174044dbc46f12191b36c..69cd7245abf533170201331488519047f24205cb 100644 (file)
@@ -54,6 +54,9 @@
 # Path to openssl config file (default: <unset> - tries to figure out system default)
 #OPENSSL_CNF=
 
+# Extra options passed to the curl binary (default: <unset>)
+#CURL_OPTS=
+
 # Program or function called in certain situations
 #
 # After generating the challenge-response, or after failed challenge (in this case altname is empty)