gpt4 book ai didi

curl - 如何为 curl Rust crate 启用 NTLM 支持?

转载 作者:行者123 更新时间:2023-12-03 11:35:12 24 4
gpt4 key购买 nike

我在带有 cargo.toml 设置的窗口上构建:

[dependencies]
curl = {version="0.4.33", features = ["ssl"]}
然后当我调用 http 服务时,我得到一个错误:
thread 'main' 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 }'
如何为 curl Rust crate 启用 NTLM 支持?

最佳答案

rust curl crate如果可以找到它,将尝试链接系统上现有的 curl 库。在这种情况下,您将只能使用编译到现有 curl 库中的功能。
根据您遇到的错误,我假设编译您的 curl 库时未启用 NTLM。您可以通过运行带有 -V 的 curl cli 程序(通常链接到库)来检查。选项:

$ curl -V
curl 7.43.0 (x86_64-redhat-linux-gnu) libcurl/7.43.0 NSS/3.19.1 Basic ECC zlib/1.2.7 libidn/1.28 libssh2/1.8.0
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz UnixSockets Metalink
如果启用 crate 功能 static-curl然后它将自己构建 curl 库并静态链接它。看来它将启用该场景中的所有适用功能(尽管我尚未对此进行测试)。

关于curl - 如何为 curl Rust crate 启用 NTLM 支持?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64149850/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com