curl-rust icon indicating copy to clipboard operation
curl-rust copied to clipboard

NTLM authentication on Windows does not work

Open stone-bits opened this issue 4 years ago • 8 comments

I'm evaluating rust for enterprise software development. It's crucial for us to have simple way to make http requests with Kerberos and NTLM authentication. I found no other crates that can do that.

I'm building on windows with cargo.toml settings:

[dependencies]
curl = {version="0.4.33", features = ["ssl", "static-curl"]}

code:

...
let mut auth = Auth::new();
auth.ntlm(true); 
let mut easy = Easy::new();
easy.http_auth(&auth).unwrap(); // here it panics
...

Running this code on windows 10 with command:

cargo run

And I'm getting the following error:

"A requested feature, protocol or option was not found built-in in this libcurl 
due to a build-time decision."

It seems natural to have NTLM on windows enabled. Maybe I'm doing something wrong?

stone-bits avatar Oct 04 '20 13:10 stone-bits

This is likely falling back to the compiled in-tree version, which doesn't have this enabled by default. I think it would make sense though for this to be a feature on the curl-sys crate so it could be enabled!

alexcrichton avatar Oct 05 '20 15:10 alexcrichton

For anyone who might want to take a stab at this, here's the place where this is getting configured in the libcurl build: https://github.com/alexcrichton/curl-rust/blob/65d360ff46dc2bdede7bb396b382f76a4c3fdfcd/curl-sys/build.rs#L106

sagebind avatar Oct 05 '20 16:10 sagebind

same problem with mac os catlina 'actix-rt:worker:1' panicked at 'called `Result::unwrap()` on an `Err` value: Error { description: "A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision.", code: 4, extra: None }',. any soultion .

sacsand avatar Mar 02 '21 07:03 sacsand

I think is is solved by #428.

We're using this crate with NTLM authentification with Windows and Linux.

pbert519 avatar Jul 08 '22 12:07 pbert519

I am facing exact same issue with ntlm authentication in latest curl crate (0.4.33). any solution suggestion please?

Jayendraz avatar Aug 07 '23 08:08 Jayendraz

Did you activate the ntlm feature?

pbert519 avatar Aug 07 '23 08:08 pbert519

I believe NTLM feature is enabled by default. I am able to access configured NLTM proxy server through web browser though.

Jayendraz avatar Aug 07 '23 09:08 Jayendraz

@pbert519 while I am being new to rust, realised little late about feature activation you asked. Below line in Cargo.toml helped to resolved issue. Thanks for help!

curl = {version="0.4.44", features = ["ntlm"]}

Jayendraz avatar Aug 07 '23 11:08 Jayendraz