Skip to content
Snippets Groups Projects
Commit 18b1c0e7 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

fix handling for issue with dns alias

parent 4af2f65f
Branches
No related tags found
1 merge request!30fix handling for issue with dns alias
......@@ -38,6 +38,7 @@
# 2023-05-08 <axel.hahn@unibe.ch> fix: "key and cert do not match"
# 2024-03-21 <axel.hahn@unibe.ch> shorter sleep times
# 2025-01-08 <axel.hahn@unibe.ch> support for http challenge on port 80; more params supported for force renew, http challenge
# 2025-01-09 <axel.hahn@unibe.ch> fix handling for issue with dns alias
# ======================================================================
......@@ -47,7 +48,7 @@
#
# ----------------------------------------------------------------------
_version="2025-01-08"
_version="2025-01-09"
logdir="./log"
touchfile="$logdir/lastchange.txt"
......@@ -246,7 +247,7 @@ function _dnsCheck(){
_wd "dig check - domain for cert"
_checkDig "$_mydomain" "a" "IN.*(A|CNAME)" # matches A and CNAME records
if [ -n "${CM_challenge_alias}" ] && ! echo "$_mydomain" | grep "${CM_certmatch}" >/dev/null
if [ -n "${CM_challenge_alias}" ] && ! echo "$_mydomain" | grep "${CM_challenge_alias}" >/dev/null
then
_wd "dig check - cname ${_subdomain}.${_mydomain} must exist"
_checkDig "${_subdomain}.${_mydomain}" "cname"
......@@ -603,12 +604,13 @@ function public_add(){
else
if [ -n "${CM_challenge_alias}" ]
then
echo "INFO: Using DNS for challenge"
_params+=" --challenge-alias "
if ! echo "$_mydomain" | grep "${CM_certmatch}" >/dev/null
if ! echo "$_mydomain" | grep "${CM_challenge_alias}" >/dev/null
then
echo "INFO: Using DNS for challenge with dns-alias to ${CM_challenge_alias} for $_mydomain"
_params+="${CM_challenge_alias} "
else
echo "INFO: Using DNS for challenge for $_mydomain"
_params+="no "
fi
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment