Browse Source

Merge remote-tracking branch 'upstream/fix-v1-renew' into patch-1

Merge v1 fix into nikdow fork
pull/443/head
cbdweb 6 years ago
parent
commit
f7296d512f
3 changed files with 11 additions and 12 deletions
  1. +2
    -0
      docker-compose.yml
  2. +9
    -2
      getssl
  3. +0
    -10
      test/run-test.sh

+ 2
- 0
docker-compose.yml View File

@ -7,6 +7,8 @@ services:
environment:
# with Go 1.13.x which defaults TLS 1.3 to on
GODEBUG: "tls13=1"
# don't reuse authorizations (breaks testing force renew)
PEBBLE_AUTHZREUSE: 0
ports:
- 14000:14000 # HTTPS ACME API
- 15000:15000 # HTTPS Management API


+ 9
- 2
getssl View File

@ -286,14 +286,15 @@ check_challenge_completion() { # checks with the ACME server if our challenge is
keyauthorization=$3
debug "sending request to ACME server saying we're ready for challenge"
send_signed_request "$uri" "{}"
# 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"
@ -303,7 +304,13 @@ 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
debug "checking if challenge is complete"
send_signed_request "$uri" ""
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)


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

@ -25,10 +25,6 @@ cp /getssl/test/test-config/getssl-http01.cfg /root/.getssl/getssl/getssl.cfg
# Test #2 - http-01 forced renewal
echo Test \#2 - http-01 forced renewal
# There's a race condition if renew too soon (authlink returns "valid" instead of "pending")
echo Sleeping 20s to allow previous validation to expire
sleep 20
/getssl/getssl getssl -f
# Test cleanup
@ -36,7 +32,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 getssl
@ -45,9 +40,4 @@ cp /getssl/test/test-config/getssl-dns01.cfg /root/.getssl/getssl/getssl.cfg
# Test #4 - dns-01 forced renewal
echo Test \#4 - dns-01 forced renewal
# There's a race condition if renew too soon (authlink returns "valid" instead of "pending")
echo Sleeping 30s to allow previous validation to expire
sleep 30
/getssl/getssl getssl -f

Loading…
Cancel
Save