line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::ACME::Certificate::Pending; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=encoding utf-8 |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Net::ACME::Certificate::Pending - for when the cert isn’t ready yet |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 SYNOPSIS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my $need_retry = Net::ACME::Certificate::Pending->new( |
12
|
|
|
|
|
|
|
uri => 'http://path/to/cert', |
13
|
|
|
|
|
|
|
retry_after => 30, #i.e., retry after 30 seconds |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my $cert; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
while (!$cert) { |
19
|
|
|
|
|
|
|
if ($need_retry->is_time_to_poll()) { |
20
|
|
|
|
|
|
|
$cert = $need_retry->poll(); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sleep 1; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=cut |
27
|
|
|
|
|
|
|
|
28
|
4
|
|
|
4
|
|
1179
|
use strict; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
88
|
|
29
|
4
|
|
|
4
|
|
11
|
use warnings; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
87
|
|
30
|
|
|
|
|
|
|
|
31
|
4
|
|
|
4
|
|
11
|
use parent qw( Net::ACME::RetryAfter ); |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
14
|
|
32
|
|
|
|
|
|
|
|
33
|
4
|
|
|
4
|
|
759
|
use Net::ACME::Certificate (); |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
283
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub _handle_non_202_poll { |
36
|
4
|
|
|
4
|
|
6
|
my ( $self, $resp ) = @_; |
37
|
|
|
|
|
|
|
|
38
|
4
|
100
|
|
|
|
57
|
$resp->die_because_unexpected() if $resp->status() != 201; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
return Net::ACME::Certificate->new( |
41
|
|
|
|
|
|
|
content => $resp->content(), |
42
|
|
|
|
|
|
|
type => $resp->header('content-type'), |
43
|
2
|
|
|
|
|
46
|
issuer_cert_uri => { $resp->links() }->{'up'}, |
44
|
|
|
|
|
|
|
); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |