{"id":"3c0ad6cf903ee6c2","repo":"redis/redis-py","slug":"no-ocsp-servers-in-certificate","errorCode":null,"errorMessage":"no ocsp servers in certificate","messagePattern":"no ocsp servers in certificate","errorType":"exception","errorClass":"ConnectionError","httpStatus":null,"severity":"error","filePath":"redis/ocsp.py","lineNumber":239,"sourceCode":"            for i in aia\n            if i.access_method == x509.oid.AuthorityInformationAccessOID.CA_ISSUERS\n        ]\n        try:\n            issuer = issuers[0].access_location.value\n        except IndexError:\n            issuer = None\n\n        # now, the series of ocsp server entries\n        ocsps = [\n            i\n            for i in aia\n            if i.access_method == x509.oid.AuthorityInformationAccessOID.OCSP\n        ]\n\n        try:\n            ocsp = ocsps[0].access_location.value\n        except IndexError:\n            raise ConnectionError(\"no ocsp servers in certificate\")\n\n        return cert, issuer, ocsp\n\n    def components_from_direct_connection(self):\n        \"\"\"Return the certificate, primary issuer, and primary ocsp server\n        from the host defined by the socket. This is useful in cases where\n        different certificates are occasionally presented.\n        \"\"\"\n\n        pem = ssl.get_server_certificate((self.HOST, self.PORT), ca_certs=self.CA_CERTS)\n        cert = x509.load_pem_x509_certificate(pem.encode(), backends.default_backend())\n        return self._certificate_components(cert)\n\n    def build_certificate_url(self, server, cert, issuer_cert):\n        \"\"\"Return the complete url to the ocsp\"\"\"\n        orb = ocsp.OCSPRequestBuilder()\n\n        # add_certificate returns an initialized OCSPRequestBuilder","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/redis/redis-py/blob/da03cdc7e8731092b13e395605c3c1fb2de25de1/redis/ocsp.py#L221-L257","documentation":"Error \"no ocsp servers in certificate\" thrown in redis/redis-py.","triggerScenarios":"Thrown at redis/ocsp.py:239 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}