]> Raphaƫl G. Git Repositories - acme/blobdiff - Acme.pm
Add new acme, acme-cron, acme-cert and acme-cron man pages
[acme] / Acme.pm
diff --git a/Acme.pm b/Acme.pm
index e4637d790ee19b87ed1f1c9748852d4d3d782cd0..2bb0aaf12f39e7793bcb8dd8a097c377c39186a3 100644 (file)
--- a/Acme.pm
+++ b/Acme.pm
@@ -49,9 +49,6 @@ use Net::Domain::TLD;
 use POSIX qw(EXIT_FAILURE);
 use Tie::IxHash;
 
-# Debug
-use Data::Dumper;
-
 # Documentation links
 #XXX: see https://letsencrypt.github.io/acme-spec/ (probably based on https://ietf-wg-acme.github.io/acme/)
 #XXX: see jwk rfc http://www.rfc-editor.org/rfc/rfc7517.txt
@@ -74,7 +71,7 @@ use constant {
        ACME_PROD_DIR => 'https://acme-v01.api.letsencrypt.org/directory',
 
        # Version
-       VERSION => 'v0.9',
+       VERSION => '1.3',
 };
 
 # User agent object
@@ -327,7 +324,7 @@ sub directory {
        my $time = time;
 
        # Set directory
-       my $dir = $self->{prod} ? ACME_PROD_DIR : ACME_DIR;
+       my $dir = $self->{domain}{prod} ? ACME_PROD_DIR : ACME_DIR;
 
        # Create a request
        my $req = HTTP::Request->new(GET => $dir.'?'.$time);
@@ -605,10 +602,10 @@ sub authorize {
        } @{$self->{domains}};
 
        # Init max run
-       my $remaining = 10;
+       my $remaining = 300;
 
        # Poll pending
-       while (--$remaining >= 0 and scalar map { $_->{status} eq 'valid' ? 1 : (); } values %{$self->{challenges}}) {
+       while (--$remaining >= 0 and scalar map { $_->{status} eq 'pending' ? 1 : (); } values %{$self->{challenges}}) {
                # Sleep
                sleep(1);
                # Poll remaining pending