Fix and extend the checks in dns_is_secure()