cargo icon indicating copy to clipboard operation
cargo copied to clipboard

Enable feature_ntlm_wb for Windows builds

Open morrijr opened this issue 1 month ago • 2 comments

Problem

Sat behind a corporate firewall that only allows NTLM authentication (Kerberos). I can setup git to authenticate, but the initial request to crates.io is failing.

Looking through the features shown when CARGO_HTTP_DEBUG is set to true and CARGO_LOG=network-debug shows that the feature_ntlm_wb is set to false.

Would it be possible to have the windows compilation of cargo enable this?

Proposed Solution

Enable feature_ntlm_wb for windows builds at least.

Notes

No response

morrijr avatar Nov 20 '25 11:11 morrijr

Forgive me for not downloading a random zip file, but what is it?

(I'm also not allowed to run a local authenticating proxy)

morrijr avatar Nov 20 '25 11:11 morrijr

I am not familiar Windows NTLM , but particular to NTLM winbind it has been deprecated since curl v8.8 (Cargo 1.83 starts using it last year November). I don't think there is a way we can enable it.

  • https://curl.se/libcurl/c/curl_version_info.html#NTLMWB
  • https://github.com/curl/curl/pull/13249

For NTLM itself, the curl crate does support NLTM via a Cargo feature. However, AFAIK, it is not recommended by upstream libcurl, and may or may not be removed in the future: https://curl.se/docs/manpage.html#--ntlm

It is a proprietary protocol, reverse-engineered by clever people and implemented in curl based on their efforts. This kind of behavior should not be endorsed, you should encourage everyone who uses NTLM to switch to a public and documented authentication method instead, such as Digest.

What exactly are you looking for, NTLM, or NTLM winbind?

weihanglo avatar Nov 20 '25 23:11 weihanglo

I wish I were sure which I would be after. I can say that it's possible to configure git to auth with the proxy and it's using libcurl?

The configuration to enable that is;

git config --global http.https://github.com.proxy http://:@proxy.internal.com:8443 git config --global http.https://github.com.proxyAuthMethod ntlm git config --global http.https://github.com.cookiefile ""

I'm hoping whatever git is doing we could do for cargo.

morrijr avatar Dec 05 '25 13:12 morrijr