{"record":{"id":"91217146d9b23a54","repo":"ducaale/xh","slug":"http-3-is-not-supported-when-using-native-tls","errorCode":null,"errorMessage":"HTTP/3 is not supported when using native-tls","messagePattern":"HTTP/3 is not supported when using native-tls","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main.rs","lineNumber":294,"sourceCode":"    }\n\n    for proxy in args.proxy.into_iter().rev() {\n        client = client.proxy(match proxy {\n            Proxy::Http(url) => reqwest::Proxy::http(url),\n            Proxy::Https(url) => reqwest::Proxy::https(url),\n            Proxy::All(url) => reqwest::Proxy::all(url),\n        }?);\n    }\n\n    client = match args.http_version {\n        Some(HttpVersion::Http10 | HttpVersion::Http11) => client.http1_only(),\n        Some(HttpVersion::Http2PriorKnowledge) => client.http2_prior_knowledge(),\n        Some(HttpVersion::Http2) => client,\n        Some(HttpVersion::Http3PriorKnowledge) => {\n            #[cfg(feature = \"http3\")]\n            {\n                if args.native_tls {\n                    return Err(anyhow!(\"HTTP/3 is not supported when using native-tls\"));\n                }\n                client.http3_prior_knowledge()\n            }\n            #[cfg(not(feature = \"http3\"))]\n            {\n                return Err(anyhow!(\n                    \"This binary was built without support for HTTP/3. Enable the `http3` feature.\"\n                ));\n            }\n        }\n        None => client,\n    };\n\n    let cookie_jar = Arc::new(reqwest_cookie_store::CookieStoreMutex::default());\n    client = client.cookie_provider(cookie_jar.clone());\n\n    client = match (args.ipv4, args.ipv6) {\n        (true, false) => client.local_address(IpAddr::from(Ipv4Addr::UNSPECIFIED)),","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/ducaale/xh/blob/2404aceecc08b0b2d100fedc96f57745cd5904dc/src/main.rs#L276-L312","documentation":"Runtime configuration check in run (the request setup path, called from main): the user selected HTTP/3 prior-knowledge (HttpVersion::Http3PriorKnowledge) while the binary was compiled against native-tls for TLS, a backend that reqwest does not allow to be combined with HTTP/3. Client construction is aborted before any request is sent; the fix is to use a rustls-based build or choose a different HTTP version.","triggerScenarios":"run() handles Some(HttpVersion::Http3PriorKnowledge) with the http3 feature enabled and args.native_tls == true.","commonSituations":"Combining --http3 (or http_version=http3) with --native-tls on the same invocation; scripts that hardcode both flags for different hosts; misunderstanding that HTTP/3 requires QUIC TLS which native-tls does not provide.","solutions":["Drop the --native-tls flag when using HTTP/3 (rustls is required).","Use a lower HTTP version (e.g. --http2) if native-tls is mandatory for your environment.","Remove the explicit HTTP/3 version option and let negotiation pick a supported version.","If you need both, use a build where HTTP/3 works and keep default TLS."],"exampleFix":"// before\nxh --http3 --native-tls GET example.org\n// after\nxh --http3 GET example.org","handlingStrategy":"validation","validationCode":"// guard before invocation\nif http3_requested && native_tls_flag { echo \"HTTP/3 requires rustls; drop --native-tls\" >&2; exit 2; }","typeGuard":null,"tryCatchPattern":"match run(args) {\n    Err(e) if e.to_string().contains(\"HTTP/3 is not supported when using native-tls\") => {\n        args.native_tls = false;\n        run(args)\n    }\n    other => other,\n}","preventionTips":["Never combine --http3 with --native-tls in scripts or wrappers.","Remember HTTP/3 requires QUIC's TLS handshake, provided via rustls here.","Encode the constraint in wrapper scripts that build the CLI arguments.","Test flag combinations in CI to catch conflicts early."],"tags":["http3","tls","cli","incompatible-options"],"backgroundTag":"mutually-exclusive-options","analyzedSha":"2404aceecc08b0b2d100fedc96f57745cd5904dc","analyzedAt":"2026-09-13T19:13:33.814Z","contentChangedAt":"2026-09-13T19:13:33.814Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}