You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ACMEScript AWS Route 53 challenge handler should be able to identify the correct Zone ID for each challenge domain name itself. This can be done my checking for the longest suffix of the domain name for which there is a zone listed in Route 53. This would negate the need to specify Zone IDs and would allow certificates for multiple domain names from different zones.
#
# Remove one level from the front of a domain name
# Returns the rest of the domain name (success), or blank if nothing left (fail)
#
function get_base_name() {
local HOSTNAME="${1}"
if [[ "$HOSTNAME" == *"."* ]]; then
HOSTNAME="${HOSTNAME#*.}"
echo "$HOSTNAME"
return 0
else
echo ""
return 1
fi
}
#
# Find the Route53 zone for this domain name
# Prefers the longest match, e.g. if creating 'a.b.foo.baa.com',
# a 'foo.baa.com' zone will be preferred over a 'baa.com' zone
# Returns the zone name (success) or nothing (fail)
#
function find_zone() {
local DOMAIN="${1}"
local ZONELIST=$(cli53 list -format json | jq --raw-output '.[].Name' | sed -e 's/\.$//' | xargs echo -n)
local TESTDOMAIN="${DOMAIN}"
while [[ -n "$TESTDOMAIN" ]]; do
for zone in $ZONELIST; do
if [[ "$zone" == "$TESTDOMAIN" ]]; then
echo "$zone"
return 0
fi
done
TESTDOMAIN=$(get_base_name "$TESTDOMAIN")
done
return 1
}
The text was updated successfully, but these errors were encountered:
The ACMEScript AWS Route 53 challenge handler should be able to identify the correct Zone ID for each challenge domain name itself. This can be done my checking for the longest suffix of the domain name for which there is a zone listed in Route 53. This would negate the need to specify Zone IDs and would allow certificates for multiple domain names from different zones.
I have an example of this in the dehydrated
hook.sh
script I wrote. It would be good to port that logic into the main script orRenew-All-Certificates.ps1
.The text was updated successfully, but these errors were encountered: