{"record":{"id":"44844b3bc54e605f","repo":"openai/codex","slug":"failed-to-register-certificate-certificate-index","errorCode":null,"errorMessage":"Failed to register certificate #{certificate_index} from {} selected by {} in rustls root store: {source}. {hint}","messagePattern":"Failed to register certificate #(.+?) from (.+?) selected by (.+?) in rustls root store: (.+?)\\. (.+?)","errorType":"exception","errorClass":"BuildCustomCaTransportError","httpStatus":null,"severity":"error","filePath":"codex-rs/http-client/src/custom_ca.rs","lineNumber":133,"sourceCode":"    /// Reqwest rejected the final client configuration after a custom CA bundle was loaded.\n    #[error(\n        \"Failed to build HTTP client while using CA bundle from {} ({}): {source}\",\n        source_env,\n        path.display()\n    )]\n    BuildClientWithCustomCa {\n        source_env: &'static str,\n        path: PathBuf,\n        #[source]\n        source: reqwest::Error,\n    },\n\n    /// Reqwest rejected the final client configuration while using only system roots.\n    #[error(\"Failed to build HTTP client while using system root certificates: {0}\")]\n    BuildClientWithSystemRoots(#[source] reqwest::Error),\n\n    /// One parsed certificate block could not be registered with the websocket TLS root store.\n    #[error(\n        \"Failed to register certificate #{certificate_index} from {} selected by {} in rustls root store: {source}. {hint}\",\n        path.display(),\n        source_env,\n        hint = CA_CERT_HINT\n    )]\n    RegisterRustlsCertificate {\n        source_env: &'static str,\n        path: PathBuf,\n        certificate_index: usize,\n        source: rustls::Error,\n    },\n}\n\nimpl From<BuildCustomCaTransportError> for io::Error {\n    fn from(error: BuildCustomCaTransportError) -> Self {\n        match error {\n            BuildCustomCaTransportError::ReadCaFile { ref source, .. } => {\n                io::Error::new(source.kind(), error)","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/http-client/src/custom_ca.rs#L115-L151","documentation":"A parsed PEM certificate block could not be added to the rustls RootCertStore while assembling TLS configuration for the websocket/reqwest transport. It fires at root-store insertion time for the certificate at the given index, usually because the block is not a decodable X.509 certificate (expired, wrong type, or corrupt DER payload); the env var and path identify the bundle it came from.","triggerScenarios":"Thrown at codex-rs/http-client/src/custom_ca.rs:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove or regenerate the certificate block at the reported index in the PEM bundle","Verify each block decodes with `openssl x509 -noout -text` before including it","Re-export the chain from the issuing CA in clean PEM format","Unset the CA env vars to fall back to system roots"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}