mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 08:03:10 +02:00
Updates for authenticator, still WIP
This commit is contained in:
@@ -16,7 +16,7 @@ It's expected that the root hosted zone for the domain in question already exist
|
|||||||
1. Install the letsencrypt-s3front plugin
|
1. Install the letsencrypt-s3front plugin
|
||||||
|
|
||||||
```
|
```
|
||||||
pip install letsencrypt-s3front
|
pip install letsencrypt-route53
|
||||||
```
|
```
|
||||||
|
|
||||||
### How to use it
|
### How to use it
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class Authenticator(common.Plugin):
|
|||||||
|
|
||||||
def get_chall_pref(self, domain):
|
def get_chall_pref(self, domain):
|
||||||
# pylint: disable=missing-docstring,no-self-use,unused-argument
|
# pylint: disable=missing-docstring,no-self-use,unused-argument
|
||||||
return [challenges.DNS]
|
return [challenges.DNS01]
|
||||||
|
|
||||||
def perform(self, achalls): # pylint: disable=missing-docstring
|
def perform(self, achalls): # pylint: disable=missing-docstring
|
||||||
responses = []
|
responses = []
|
||||||
@@ -48,8 +48,8 @@ class Authenticator(common.Plugin):
|
|||||||
# provision the TXT record, using the domain name given. Assumes the hosted zone exits, else fails the challenge
|
# provision the TXT record, using the domain name given. Assumes the hosted zone exits, else fails the challenge
|
||||||
response, validation = achall.response_and_validation()
|
response, validation = achall.response_and_validation()
|
||||||
r53 = boto3.client('route53')
|
r53 = boto3.client('route53')
|
||||||
logger.info("Doing validation for " + achall)
|
logger.info("Doing validation for " + response.domain)
|
||||||
listResponse = r53.list_hosted_zones_by_name(DNSName=achall.chall.path[1:])
|
listResponse = r53.list_hosted_zones_by_name(DNSName=response.domain)
|
||||||
matches = listResponse.HostedZones;
|
matches = listResponse.HostedZones;
|
||||||
if matches.size != 0:
|
if matches.size != 0:
|
||||||
logger.error("Route53 returned " + mathces.size + " matching hosted zones. Expected exactly one. Auth canceled.")
|
logger.error("Route53 returned " + mathces.size + " matching hosted zones. Expected exactly one. Auth canceled.")
|
||||||
@@ -62,7 +62,7 @@ class Authenticator(common.Plugin):
|
|||||||
{
|
{
|
||||||
'Action': 'UPSERT',
|
'Action': 'UPSERT',
|
||||||
'ResourceRecordSet': {
|
'ResourceRecordSet': {
|
||||||
'Name': achall.chall.path[1:],
|
'Name': achall.validation_domain_name(),
|
||||||
'Type': 'TXT',
|
'Type': 'TXT',
|
||||||
'TTL': 300,
|
'TTL': 300,
|
||||||
'ResourceRecords': [
|
'ResourceRecords': [
|
||||||
|
|||||||
Reference in New Issue
Block a user