Retrieve certificate host name from subjectAltName DNS entry if one exists.

Normally, the host name is matched against the CN attribute.  This patch
now checks for a subjectAltName x509v3 extension, and looks for a DNS entry.
One the first entry will be used.  If found, the host name is checked against
it instead.