Fixes to host checking wild card support and add support for setting host checking flags when verifying a certificate chain. (cherry picked from commit 397a8e747dc3f964196caed5ca4e08d4b598362a)
(cherry picked from commit 2b4ffc659eabec29f76821f0ac624a2b8c19e4c7)