Verify host insecurely (they may have self signed certs)

This commit is contained in:
Lutchy Horace 2021-02-17 12:10:55 -05:00
parent 2887346ee1
commit f71d76bc39
1 changed files with 2 additions and 1 deletions

View File

@ -29,7 +29,8 @@ function validate_host
echo "$1" | grep -P '^(http|https):\/\/(([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])(:[0-9]+)?$' > /dev/null 2>&1
if [ $? -eq 0 ]; then
debug "Checking host is resolvable: $1"
curl $1 > /dev/null 2>&1
# The remote servers may sometimes have self-signed certs
curl --insecure $1 > /dev/null 2>&1
fi
return $?
}