Check the certificate chain is valid up to a trusted root, and
optionally (if hostname != "") that the hostname given is
consistent with the leaf certificate.
This function should throw new an exception derived from
Exception with an informative what() result if the
certificate chain cannot be verified.
Check the certificate chain is valid up to a trusted root, and optionally (if hostname != "") that the hostname given is consistent with the leaf certificate.
This function should throw new an exception derived from Exception with an informative what() result if the certificate chain cannot be verified.