]> git.ipfire.org Git - thirdparty/dehydrated.git/commitdiff
implement POST-as-GET (closes #626)
authorLukas Schauer <lukas@schauer.so>
Sun, 3 Mar 2019 18:58:04 +0000 (19:58 +0100)
committerLukas Schauer <lukas@schauer.so>
Sun, 3 Mar 2019 19:00:13 +0000 (20:00 +0100)
CHANGELOG
dehydrated

index 05b40d912fec7444775bd071a7f02a0548892c16..80d125d07e648694e208643d9f26f774b1cfc765 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,6 +4,7 @@ This file contains a log of major changes in dehydrated
 ## [x.x.x] - xxxx-xx-xx
 ## Changed
 - OCSP refresh interval is now configurable
+- Implemented POST-as-GET
 
 ## Added
 - Initial support for tls-alpn-01 validation
index c4096b7c9582bcc1b0b1f20d3486f2e611c4bfe7..d0cfdb4b0d7335955d2213e3a0dd749a0da57fc3 100755 (executable)
@@ -710,7 +710,7 @@ sign_csr() {
   for authorization in ${authorizations[*]}; do
     if [[ "${API}" -eq 2 ]]; then
       # Receive authorization ($authorization is authz uri)
-      response="$(http_request get "$(echo "${authorization}" | _sed -e 's/\"(.*)".*/\1/')" | clean_json)"
+      response="$(signed_request "$(echo "${authorization}" | _sed -e 's/\"(.*)".*/\1/')" "" | clean_json)"
       identifier="$(echo "${response}" | get_json_dict_value identifier | get_json_string_value value)"
       echo " + Handling authorization for ${identifier}"
     else
@@ -802,7 +802,11 @@ sign_csr() {
 
     while [[ "${reqstatus}" = "pending" ]]; do
       sleep 1
-      result="$(http_request get "${challenge_uris[${idx}]}")"
+      if [[ "${API}" -eq 2 ]]; then
+        result="$(signed_request "${challenge_uris[${idx}]}" "")"
+      else
+        result="$(http_request get "${challenge_uris[${idx}]}")"
+      fi
       reqstatus="$(printf '%s\n' "${result}" | get_json_string_value status)"
     done
 
@@ -850,7 +854,7 @@ sign_csr() {
     crt="$( printf -- '-----BEGIN CERTIFICATE-----\n%s\n-----END CERTIFICATE-----\n' "${crt64}" )"
   else
     result="$(signed_request "${finalize}" '{"csr": "'"${csr64}"'"}' | clean_json | get_json_string_value certificate)"
-    crt="$(http_request get "${result}")"
+    crt="$(signed_request "${result}" "")"
   fi
 
   # Try to load the certificate to detect corruption