Repository navigation
Fix ntlm feature broken by libcurl 8.20's NTLM opt-in flip - #665
Open
ns-ylambert wants to merge 1 commit into
Open
ns-ylambert wants to merge 1 commit into
ns-ylambert wants to merge 1 commit into
Conversation
libcurl 8.20 (released 2026-04-29) flipped NTLM to opt-in behind `CURL_ENABLE_NTLM` (curl/curl#20698, commit [`cc0c83c5f853`]). In `lib/curl_setup.h`: /* Single point where USE_NTLM definition might be defined */ -#ifndef CURL_DISABLE_NTLM +#ifdef CURL_ENABLE_NTLM The change was security-driven (weak auth, no HTTP/2/3 support). Same PR also removed every reference to `CURL_DISABLE_NTLM` from libcurl's source, docs, CMake, and configure logic. **The old opt-out symbol was retired entirely**. curl-sys did not propagate the change downstream: the `ntlm` cargo feature (sagebind#428, commit [`f0bbf37241e2`]) still only compiles NTLM source files. Else-branch defines `CURL_DISABLE_NTLM`, which is now dead code. The `.define("CURL_ENABLE_NTLM", None)` that the opt-in contract now requires was never added. Result: from curl-sys 0.4.90+curl-8.20.0 onward (released 2026-05-01), `--features curl-sys/ntlm` compiles the NTLM sources but exports zero NTLM symbols, so the feature does nothing. Two edits, cross-platform (whoever activates `curl-sys/ntlm` opts in on any platform): - Add `.define("CURL_ENABLE_NTLM", None)` alongside the existing NTLM `.file(...)` calls so the feature does what it advertises again. - Drop the now-dead `else { cfg.define("CURL_DISABLE_NTLM", None); }` branch. Plus, a regression test in `src/lib.rs`'s `mod tests` asserting that `Version::feature_ntlm()` is `true` when the `ntlm` feature is enabled. [`cc0c83c5f853`]: curl/curl@cc0c83c5f853 [`f0bbf37241e2`]: sagebind@f0bbf37241e2
ns-ylambert
force-pushed
the
fix-ntlm-enable
branch
from
October 12, 2026 18:01
4e5c484 to
f524cd1
Compare
Author
|
Rebased onto current Ready for review whenever you have a moment, happy to restructure if a different split is easier. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
libcurl 8.20 (released 2026-04-29) flipped NTLM from opt-out to opt-in behind
CURL_ENABLE_NTLM(curl/curl#20698, commitcc0c83c5f853). curl-sys picked up the libcurl bump in #649 (2026-05-01) but didn't propagate the opt-in contract: thentlmcargo feature (introduced by #428, commitf0bbf37241e2) still only compiles the NTLM source files. From curl-sys0.4.90+curl-8.20.0onward,--features curl-sys/ntlmbuilds cleanly but exports zero NTLM symbols: the feature silently does nothing at runtime.Fix
curl-sys/build.rs, inside theif cfg!(feature = "ntlm") { ... }block:.define("CURL_ENABLE_NTLM", None): the macro libcurl now requires to activate NTLM.CURL_DISABLE_NTLM: same curl PR that flipped the gate removed every reference to that macro from libcurl's source, docs, cmake, and configure logic; it's dead.Cross-platform (not target-scoped): whoever activates
curl-sys/ntlmopts in on any platform.Also adds a regression test in
src/lib.rs'smod tests:is_ntlm_support_activatedassertsVersion::feature_ntlm() == truewhen the crate'sntlmfeature is enabled. Fails on anycurl-sys 0.4.90+curl-8.20.0or later without this fix.Verification
cargo check -p curl-sys --features static-curl,ntlm --target x86_64-pc-windows-msvcsucceeds; the resulting binary now contains NTLM symbols.cargo test --features static-curl,ntlm --target x86_64-pc-windows-msvc is_ntlm_support_activated→test tests::is_ntlm_support_activated ... ok.Note on CI coverage of the regression test
ci/run.shcurrently compiles the new test in the--no-runpass at line 36 (cargo test --no-run --features static-curl,protocol-ftp,ntlm) but does not execute it. No line in theif [ -z "$NO_RUN" ]block enables--features ntlm. Addingaround line 41 would promote the test from a compile-verified reproducer to a CI-executed guard against future regressions of the same class. Kept out of this PR to keep the diff minimal; happy to add if desired.
Related
--features ntlmat all — but the same runtime error ("A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision") now hits users who correctly enable the feature but are on curl-sys 0.4.90+curl-8.20.0 or later.