{"record":{"id":"53542b775f663603","repo":"hatoo/oha","slug":"failed-to-build-native-tls-tlsconnector","errorCode":null,"errorMessage":"Failed to build native_tls::TlsConnector","messagePattern":"Failed to build native_tls::TlsConnector","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/tls_config.rs","lineNumber":118,"sourceCode":"            if insecure {\n                connector_builder\n                    .danger_accept_invalid_certs(true)\n                    .danger_accept_invalid_hostnames(true);\n            }\n\n            if let Some((cert, key)) = client_auth {\n                let cert = native_tls::Identity::from_pkcs8(cert, key)\n                    .expect(\"Failed to parse client_auth cert/key\");\n                connector_builder.identity(cert);\n            }\n\n            if is_http2 {\n                connector_builder.request_alpns(&[\"h2\"]);\n            }\n\n            connector_builder\n                .build()\n                .expect(\"Failed to build native_tls::TlsConnector\")\n                .into()\n        };\n\n        Self {\n            no_alpn: new(false),\n            alpn_h2: new(true),\n        }\n    }\n\n    pub fn connector(&self, is_http2: bool) -> &tokio_native_tls::TlsConnector {\n        if is_http2 {\n            &self.alpn_h2\n        } else {\n            &self.no_alpn\n        }\n    }\n}\n","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/hatoo/oha/blob/4efba2d113d165aaaf7533f5d2893e7cc57ebfc1/src/tls_config.rs#L100-L136","documentation":"Final step of NativeTlsConnectors::new: connector_builder.build() is unwrapped with expect() and this message when the TLS connector cannot be constructed after all settings were applied — for example an invalid ALPN configuration, contradictory builder options, or an identity/certificate already rejected at a deeper stage. It indicates builder-level failure, not a network or remote-certificate problem.","triggerScenarios":"Thrown at src/tls_config.rs:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the combined builder options (cacert, identity, ALPN 'h2', danger-accept flags) for contradictions; simplify by disabling options one at a time.","Update or verify the native_tls / openssl backend version for known build() panics.","Test with a minimal builder (no cacert, no client auth) to isolate which added option breaks construction.","Capture the underlying error that expect() discards by replacing expect with proper error propagation."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4efba2d113d165aaaf7533f5d2893e7cc57ebfc1","analyzedAt":"2026-09-09T16:24:23.306Z","contentChangedAt":"2026-09-09T16:24:23.306Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}