From 8333a1e8175d8cd20a207a6222a3ff2441bc3125 Mon Sep 17 00:00:00 2001 From: Tim Kimber Date: Sat, 28 Nov 2020 11:26:13 +0000 Subject: [PATCH] Update version to 2.31 Fix bug with nslookup server param --- getssl | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/getssl b/getssl index be7f2bc..1fb58fb 100755 --- a/getssl +++ b/getssl @@ -241,12 +241,12 @@ # 2020-10-02 Various fixes to get_auth_dns and changes to support unit tests (#308) # 2020-10-04 Add CHECK_PUBLIC_DNS_SERVER to check the DNS challenge has been updated there # 2020-10-13 Bugfix: strip comments in drill/dig output (mhameed) -# 2020-11-18 Wildcard support (#347)(#400) +# 2020-11-18 Wildcard support (#347)(#400)(2.31) # ---------------------------------------------------------------------------------------- PROGNAME=${0##*/} PROGDIR="$(cd "$(dirname "$0")" || exit; pwd -P;)" -VERSION="2.30" +VERSION="2.31" # defaults ACCOUNT_KEY_LENGTH=4096 @@ -1255,13 +1255,11 @@ done # end of ... loop through domains for cert ( from SANS list) get_auth_dns() { # get the authoritative dns server for a domain (sets primary_ns ) orig_gad_d="$1" # domain name - gad_s="$PUBLIC_DNS_SERVER" # start with PUBLIC_DNS_SERVER - if [[ -n "$gad_s" ]]; then - gad_s="@$gad_s" - fi + orig_gad_s="$PUBLIC_DNS_SERVER" # start with PUBLIC_DNS_SERVER + gad_d="$orig_gad_d" + gad_s="$orig_gad_s" if [[ "$os" == "cygwin" ]]; then - gad_d="$orig_gad_d" # shellcheck disable=SC2086 all_auth_dns_servers=$(nslookup -type=soa "${d}" ${PUBLIC_DNS_SERVER} 2>/dev/null \ | grep "primary name server" \ @@ -1278,7 +1276,10 @@ get_auth_dns() { # get the authoritative dns server for a domain (sets primary_n fi if [[ -n "$HAS_DIG_OR_DRILL" ]]; then - gad_d="$orig_gad_d" + if [[ -n "$gad_s" ]]; then + gad_s="@$gad_s" + fi + # Use SOA +trace to find the name server if [[ $_TEST_SKIP_SOA_CALL == 0 ]]; then if [[ "$HAS_DIG_OR_DRILL" == "dig" ]]; then @@ -1350,6 +1351,9 @@ get_auth_dns() { # get the authoritative dns server for a domain (sets primary_n fi fi + # Remove leading '@' if we tried using dig/drill + gad_s="$orig_gad_s" + if [[ "$HAS_HOST" == "true" ]]; then gad_d="$orig_gad_d" debug Using "host -t NS" to find primary name server for "$gad_d"