Fixes to host checking. Fixes to host checking wild card support and add support for setting host checking flags when verifying a certificate chain. (Imported from upstream's a2219f6be36d12f02b6420dd95f819cf364baf1d)