aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-05-16 20:47:12 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2017-05-16 20:48:43 +0200
commitd1f7b80ca931dc98bb40df305b6927fa9711234b (patch)
treef5669b541269b9242fcbeb90d6a8a85243a5508a
parent952d12825c2c480a839680d3c2ca0bd67a46aaac (diff)
downloadacme-tinier-d1f7b80ca931dc98bb40df305b6927fa9711234b.tar.gz
acme-tinier-d1f7b80ca931dc98bb40df305b6927fa9711234b.tar.xz
acme-tinier-d1f7b80ca931dc98bb40df305b6927fa9711234b.zip
Improve error messages
-rwxr-xr-xacme-tinier.pl10
1 files changed, 5 insertions, 5 deletions
diff --git a/acme-tinier.pl b/acme-tinier.pl
index a09f112..5e877a0 100755
--- a/acme-tinier.pl
+++ b/acme-tinier.pl
@@ -85,7 +85,7 @@ die 'cannot parse CSR' if $?;
my @domains;
push @domains, $1 if $csr =~ /Subject:.*? CN *= *([^\s,;\/]+)/;
-# FIXME: this may not parse correctly either, try it out
+# FIXME: this may not parse correctly anymore, try it out
push @domains, map { substr $_, 4 } grep { /^DNS:/ } split(/, /)
for $csr =~ /X509v3 Subject Alternative Name: \n +([^\n]+)\n/g;
@@ -121,7 +121,7 @@ for my $domain (@domains) {
eval {
my $url = "http://$domain/.well-known/acme-challenge/$token";
my ($code, $result) = get $url;
- die "checking challenge failed: $code" if $code != 200;
+ die "checking $url failed: $code" if $code != 200;
die 'challenge contents differ' if $result ne $key_auth;
# Submit the challenge and wait for the verification to finish
@@ -129,18 +129,18 @@ eval {
resource => 'challenge',
keyAuthorization => $key_auth
});
- die "checking challenge failed: $code" if $code != 202;
+ die "challenge submission failed: $code" if $code != 202;
while (1) {
($code, $result) = get $challenge->{uri};
- die "verifying challenge failed: $code" if $code >= 400;
+ die "challenge verification failed: $code" if $code >= 400;
my $status = $json->decode($result);
if ($status->{status} eq 'valid') {
last;
} elsif ($status->{status} eq 'pending') {
sleep 1;
} else {
- die "verifying challenge failed: $status";
+ die "challenge verification failed: $result";
}
}
};