| 1 | package Net::ACME::Challenge::Pending::http_01; | ||
| 2 | |||
| 3 | =encoding utf-8 | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | Net::ACME::Challenge::Pending::http_01 - unhandled http-01 challenge | ||
| 8 | |||
| 9 | =head1 SYNOPSIS | ||
| 10 | |||
| 11 | use Net::ACME::Challenge::Pending::http_01 (); | ||
| 12 | |||
| 13 | my $challenge = Net::ACME::Challenge::Pending::http_01->new( | ||
| 14 | |||
| 15 | #i.e., from the ACME new-authz call | ||
| 16 | uri => 'https://post/url/for/challenge', | ||
| 17 | token => 'sdgflih4we', | ||
| 18 | ); | ||
| 19 | |||
| 20 | { | ||
| 21 | my $handler = $challenge->create_handler( | ||
| 22 | '/path/to/docroot', | ||
| 23 | $jwk, #public | ||
| 24 | ); | ||
| 25 | |||
| 26 | #Suggest verification that the URI matches content. | ||
| 27 | #cf. docs for Net::ACME | ||
| 28 | |||
| 29 | my $acme = Net::ACME::SomeService->new(); | ||
| 30 | $acme->do_challenge($challenge); | ||
| 31 | |||
| 32 | #wait until the challenge’s authz is resolved | ||
| 33 | } | ||
| 34 | |||
| 35 | #Once $handler goes out of scope, the filesystem preparation is undone. | ||
| 36 | |||
| 37 | =head1 DESCRIPTION | ||
| 38 | |||
| 39 | This class handles responses to C<http-01> challenges, specifically by | ||
| 40 | facilitating easy setup and teardown of proper domain control validation (DCV) | ||
| 41 | files within a given document root. | ||
| 42 | |||
| 43 | To work with challenges that have been handled (successfully or not), | ||
| 44 | see C<Net::ACME::Challenge>. | ||
| 45 | |||
| 46 | =cut | ||
| 47 | |||
| 48 | 10 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 49 | 10 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 50 | |||
| 51 | 10 | use parent qw( | |
| 52 | Net::ACME::Challenge::Pending | ||
| 53 | 10 | ▶ | ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 54 | |||
| 55 | 10 | ▶ | use Net::ACME::Challenge::Pending::http_01::Handler (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 56 | |||
| 57 | sub create_handler { | ||
| 58 | 3 | ▶ | my ( $self, $docroot, $jwk ) = @_; |
|
Subroutine
create_handler: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 59 | |||
| 60 | 3 | return Net::ACME::Challenge::Pending::http_01::Handler->new( | |
| 61 | token => $self->token(), | ||
| 62 | key_authz => $self->make_key_authz($jwk), | ||
| 63 | docroot => $docroot, | ||
| 64 | ); | ||
| 65 | } | ||
| 66 | |||
| 67 | 10 | 1; | |