diff --git a/cipherscan b/cipherscan index b560052..7d3f3c1 100755 --- a/cipherscan +++ b/cipherscan @@ -1534,8 +1534,12 @@ SCLIENTARGS="${PARAMS[*]}" # only append the SNI: # if the target is a hostname by validating the tld # if -servername was not supplied by the user -if [[ $SNI == "True" && $sni_target =~ \.[a-z]{1,20}$ && ! $SCLIENTARGS =~ servername ]]; then - SCLIENTARGS="$SCLIENTARGS -servername $sni_target" +if [[ $SNI == "True" && ! $SCLIENTARGS =~ servername ]]; then + if [[ $sni_target =~ \.[a-zA-Z]{1,20}$ ]]; then + SCLIENTARGS="$SCLIENTARGS -servername $sni_target" + else + echo "Warning: target is not a FQDN. SNI was disabled. Use a FQDN or '-servername '" 1>&2 + fi fi debug "sclientargs: $SCLIENTARGS"