{"id":"6d699e24b6676e4f","repo":"redis/redis-py","slug":"no-matching-issuer-cert-found-in-certificate-chain","errorCode":null,"errorMessage":"no matching issuer cert found in certificate chain","messagePattern":"no matching issuer cert found in certificate chain","errorType":"exception","errorClass":"ConnectionError","httpStatus":null,"severity":"error","filePath":"redis/ocsp.py","lineNumber":160,"sourceCode":"def ocsp_staple_verifier(con, ocsp_bytes, expected=None):\n    \"\"\"An implementation of a function for set_ocsp_client_callback in PyOpenSSL.\n\n    This function validates that the provide ocsp_bytes response is valid,\n    and matches the expected, stapled responses.\n    \"\"\"\n    if ocsp_bytes in [b\"\", None]:\n        raise ConnectionError(\"no ocsp response present\")\n\n    issuer_cert = None\n    peer_cert = con.get_peer_certificate().to_cryptography()\n    for c in con.get_peer_cert_chain():\n        cert = c.to_cryptography()\n        if cert.subject == peer_cert.issuer:\n            issuer_cert = cert\n            break\n\n    if issuer_cert is None:\n        raise ConnectionError(\"no matching issuer cert found in certificate chain\")\n\n    if expected is not None:\n        e = x509.load_pem_x509_certificate(expected)\n        if peer_cert != e:\n            raise ConnectionError(\"received and expected certificates do not match\")\n\n    return _check_certificate(issuer_cert, ocsp_bytes)\n\n\nclass OCSPVerifier:\n    \"\"\"A class to verify ssl sockets for RFC6960/RFC6961. This can be used\n    when using direct validation of OCSP responses and certificate revocations.\n\n    @see https://datatracker.ietf.org/doc/html/rfc6960\n    @see https://datatracker.ietf.org/doc/html/rfc6961\n    \"\"\"\n\n    def __init__(self, sock, host, port, ca_certs=None):","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/redis/redis-py/blob/da03cdc7e8731092b13e395605c3c1fb2de25de1/redis/ocsp.py#L142-L178","documentation":"Error \"no matching issuer cert found in certificate chain\" thrown in redis/redis-py.","triggerScenarios":"Thrown at redis/ocsp.py:160 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"da03cdc7e8731092b13e395605c3c1fb2de25de1","analyzedAt":"2026-08-04T20:26:47.563Z","schemaVersion":2}