aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rwxr-xr-xclient11
1 files changed, 9 insertions, 2 deletions
diff --git a/client b/client
index 2566c9b..46f388f 100755
--- a/client
+++ b/client
@@ -284,10 +284,17 @@ elsif ($COMMAND eq 'new-cert') {
keyAuthorization => $keyAuthorization
});
# wait until the status become 'valid'
- for ( my $i = 0, my $status;
- $status = request_json_decode($r)->{status} // 'pending',
+ for ( my $i = 0, my $content, my $status;
+ $content = request_json_decode($r),
+ $status = $content->{status} // 'pending',
$status ne 'valid';
$r = request('GET' => $challenge->{uri}), $i++ ) {
+ if (defined (my $problem = $content->{error})) { # problem document (RFC 7807)
+ my $msg = $problem->{status};
+ $msg .= " " .$problem->{title} if defined $problem->{title};
+ $msg .= " (".$problem->{detail}.")" if defined $problem->{detail};
+ die $msg, "\n";
+ }
die "Error: Invalid challenge for $domain (status: ".$status.")\n" if $status ne 'pending';
die "Timeout exceeded while waiting for challenge to pass ($domain)\n"
if $i >= ($CONFIG->{timeout} // 10);