Browse Source

Merge branch 'master' of github.com:srvrco/getssl

pull/740/head
Tim Kimber 6 years ago
parent
commit
58840d63ec
3 changed files with 2576 additions and 6 deletions
  1. +13
    -5
      getssl
  2. +2563
    -0
      getssl-dual
  3. +0
    -1
      test/run-test.sh

+ 13
- 5
getssl View File

@ -196,10 +196,11 @@
# 2020-01-07 #464 and #486 "json was blank" (change all curl request to use POST-as-GET)
# 2020-01-08 Error and exit if rate limited, exit if curl returns nothing
# 2020-01-10 Change domain and getssl templates to v2 (2.15)
# 2020-01-17 #473 and #477 Don't use POST-as-GET when sending ready for challenge for ACMEv1 (2.16)
# ----------------------------------------------------------------------------------------
PROGNAME=${0##*/}
VERSION="2.15"
VERSION="2.16"
# defaults
ACCOUNT_KEY_LENGTH=4096
@ -287,15 +288,16 @@ check_challenge_completion() { # checks with the ACME server if our challenge is
domain=$2
keyauthorization=$3
info "sending request to ACME server saying we're ready for challenge"
send_signed_request "$uri" "{}"
debug "sending request to ACME server saying we're ready for challenge"
# check response from our request to perform challenge
if [[ $API -eq 1 ]]; then
send_signed_request "$uri" "{\"resource\": \"challenge\", \"keyAuthorization\": \"$keyauthorization\"}"
if [[ -n "$code" ]] && [[ ! "$code" == '202' ]] ; then
error_exit "$domain:Challenge error: $code"
fi
else # APIv2
send_signed_request "$uri" "{}"
if [[ -n "$code" ]] && [[ ! "$code" == '200' ]] ; then
detail=$(echo "$response" | grep "detail" | awk -F\" '{print $4}')
error_exit "$domain:Challenge error: $code:Detail: $detail"
@ -304,8 +306,14 @@ check_challenge_completion() { # checks with the ACME server if our challenge is
# loop "forever" to keep checking for a response from the ACME server.
while true ; do
info "checking if challenge is complete"
send_signed_request "$uri" ""
debug "checking if challenge is complete"
if [[ $API -eq 1 ]]; then
if ! get_cr "$uri" ; then
error_exit "$domain:Verify error:$code"
fi
else # APIv2
send_signed_request "$uri" ""
fi
status=$(json_get "$response" status)


+ 2563
- 0
getssl-dual
File diff suppressed because it is too large
View File


+ 0
- 1
test/run-test.sh View File

@ -34,7 +34,6 @@ rm -r /root/.getssl
# Test #3 - dns-01 verification
echo Test \#3 - dns-01 verification
cp /getssl/test/test-config/nginx-ubuntu-no-ssl /etc/nginx/sites-enabled/default
service nginx restart
/getssl/getssl -c $HOST


Loading…
Cancel
Save