dns_aws: Fix when _acme-challenge is a hostedzone

The function '_get_root' tries to retrieve the
    hostedzone iterating the domains, eg:
      1. srv.prod.example.com
      2. prod.example.com
      3. example.com
    This doesn't work if '_acme-challenge' is in it's
    own hostedzone for security reasons.
    Starting that iteration with '_acme-challenge.srv.prod.example.com'
    fixes this issue.
This commit is contained in:
Manuel Sanchez Pinar 2022-05-12 10:51:15 +02:00
parent bee5cb55a1
commit 2280e66d73

View File

@ -151,8 +151,8 @@ dns_aws_rm() {
#################### Private functions below ##################################
_get_root() {
domain=$1
i=2
domain=_acme-challenge.$1
i=1
p=1
if aws_rest GET "2013-04-01/hostedzone"; then