Describe the bug cargo deny --format json check advisories

prints

{"fields":{"level":"ERROR","message":"'NTLM' authentication is not supported; class=Http (34)","timestamp":"2022-07-15T09:58:23.082045256Z"},"type":"log"}

cargo-deny 0.12.1

0

What OS is this on?

0

ubuntu0.20.04.1 behind a corp proxy with correct http_proxy, https_proxy and no_proxy set. Other cargo commands work fine. I noticed the same behavior with cargo audit, the error message is just slightly different:

cargo audit
error: couldn't fetch advisory database: git operation failed: 'NTLM' authentication is not supported; class=Http (34)

I tried to exec rm -rf ~/.cargo/advisory-db beforehand as reported in some old issues but that does not help in my case.

0

You can try adding this to your config to see if that resolves this issue.

[advisories]
git-fetch-with-cli = true

Otherwise you could add a PR to improve the setup of the libgit2 authentication at https://github.com/EmbarkStudios/cargo-deny/blob/824c2d1304086861ce66b0386d4852d2fab42b81/src/advisories/helpers.rs#L217, unfortunately scenarios such as yours rely on contributions from people who actually have a repro for the issue.

0

Setting

[advisories]
git-fetch-with-cli = true

leads to

$ cargo-deny check advisories
Cloning into '/home/runner/.cargo/advisory-db/github.com-2f857891b7f43c59'...
fatal: unable to access 'https://github.com/rustsec/advisory-db/': Received HTTP code 407 from proxy after CONNECT
2022-07-15 14:10:05 [ERROR] failed to open advisory database: failed to resolve path '/home/runner/.cargo/advisory-db/github.com-2f857891b7f43c59': No such file or directory; class=Os (2); code=NotFound (-3
0

Ok, well in that case you'd need to make a PR to either improve the libgit2 authentication setup I mentioned above, or the CLI path if it is easier, as I have no idea why git itself would fail if it works in other scenarios.

0

Ok, how is that related to the CLI path?

0

It's not, I'm saying you could improve either path depending on which is easier for you.

0
© 2022 pullanswer.com - All rights reserved.