verifyHostname

fnbool verifyHostname(X509Certificate cert, string hostname) @safe

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

certThe certificate to check.
hostnameThe hostname to verify (e.g., "www.example.com").

Returns

True if the certificate is valid for the hostname.