verifyHostname
Verifies that a certificate is valid for the given hostname.
Checks the Subject Alternative Name extension for DNS names, falling back to the Common Name if no SAN is present.
Parameters
cert | The certificate to check. |
hostname | The hostname to verify (e.g., "www.example.com"). |
Returns
True if the certificate is valid for the hostname.