ACME/LetsEncrypt.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 31 CC 1 SCAR 6.9
CC
1
Cov
0%
get_terms_of_service
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Net::ACME::LetsEncrypt;
2  
3 use strict;
4 use warnings;
5  
6 use parent qw(Net::ACME);
7  
8 use Net::ACME::HTTP ();
9  
10 use constant STAGING_SERVER => 'acme-staging.api.letsencrypt.org';
11  
12 use constant PRODUCTION_SERVER => 'acme-v01.api.letsencrypt.org';
13  
14 *_HOST = \&PRODUCTION_SERVER;
15  
16 #https://community.letsencrypt.org/t/terms-of-service-without-registration/21328/2
17 sub get_terms_of_service {
18 my ($self) = @_;
19  
20 my $host = $self->_HOST();
21  
22 my $resp = Net::ACME::HTTP->new()->get("https://$host/terms");
23  
24 return $resp->header('location');
25 }
26  
27 1;