implement POST-as-GET (closes #626)

This commit is contained in:
Lukas Schauer
2019-03-03 19:58:04 +01:00
parent 585ed5404b
commit e623fcc024
2 changed files with 8 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ This file contains a log of major changes in dehydrated
## [x.x.x] - xxxx-xx-xx ## [x.x.x] - xxxx-xx-xx
## Changed ## Changed
- OCSP refresh interval is now configurable - OCSP refresh interval is now configurable
- Implemented POST-as-GET
## Added ## Added
- Initial support for tls-alpn-01 validation - Initial support for tls-alpn-01 validation

View File

@@ -710,7 +710,7 @@ sign_csr() {
for authorization in ${authorizations[*]}; do for authorization in ${authorizations[*]}; do
if [[ "${API}" -eq 2 ]]; then if [[ "${API}" -eq 2 ]]; then
# Receive authorization ($authorization is authz uri) # 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)" identifier="$(echo "${response}" | get_json_dict_value identifier | get_json_string_value value)"
echo " + Handling authorization for ${identifier}" echo " + Handling authorization for ${identifier}"
else else
@@ -802,7 +802,11 @@ sign_csr() {
while [[ "${reqstatus}" = "pending" ]]; do while [[ "${reqstatus}" = "pending" ]]; do
sleep 1 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)" reqstatus="$(printf '%s\n' "${result}" | get_json_string_value status)"
done done
@@ -850,7 +854,7 @@ sign_csr() {
crt="$( printf -- '-----BEGIN CERTIFICATE-----\n%s\n-----END CERTIFICATE-----\n' "${crt64}" )" crt="$( printf -- '-----BEGIN CERTIFICATE-----\n%s\n-----END CERTIFICATE-----\n' "${crt64}" )"
else else
result="$(signed_request "${finalize}" '{"csr": "'"${csr64}"'"}' | clean_json | get_json_string_value certificate)" result="$(signed_request "${finalize}" '{"csr": "'"${csr64}"'"}' | clean_json | get_json_string_value certificate)"
crt="$(http_request get "${result}")" crt="$(signed_request "${result}" "")"
fi fi
# Try to load the certificate to detect corruption # Try to load the certificate to detect corruption