fixes #6589 - add trusted_hosts check back