def verify(cert_path, issuer_chain_path):
    """
    Verify a certificate using OCSP and CRL

    :param cert_path:
    :param issuer_chain_path:
    :return: True if valid, False otherwise
    """
    with open(cert_path) as c:
        try:
            cert = parse_certificate(c.read())
        except ValueError as e:
            current_app.logger.error(e)
            return None

    # OCSP is our main source of truth, in a lot of cases CRLs
    # have been deprecated and are no longer updated
    verify_result = None
    ocsp_err = 0
    crl_err = 0
    try:
        verify_result = ocsp_verify(cert, cert_path, issuer_chain_path)
    except Exception as e:
        capture_exception()
        current_app.logger.warning(e)
        ocsp_err = 1

    if verify_result is None:
        try:
            verify_result = crl_verify(cert, cert_path)
        except Exception as e:
            capture_exception()
            current_app.logger.warning(e)
            crl_err = 1

    if verify_result is None:
        current_app.logger.warning(f"Failed to verify {cert.serial_number}")

    return verify_result, ocsp_err, crl_err

    Verify a certificate using OCSP and CRL

    :param cert_path:
    :param issuer_chain_path:
    :return: True if valid, False otherwise
    
lemur/certificates/verify.py