| 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; |