rust-secure-code / cargo-supply-chain

Gather author, contributor and publisher data on crates in your dependency graph.
Apache License 2.0
316 stars 19 forks source link

Could not load platform certs: "The Trust Settings Record was corrupted." #44

Open trevyn opened 3 years ago

trevyn commented 3 years ago
$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.14.6
BuildVersion:   18G8022
$ rustc --version
rustc 1.50.0 (cb75ad5db 2021-02-10)
$ cargo install cargo-supply-chain
[...]
   Installed package `cargo-supply-chain v0.1.1` (executable `cargo-supply-chain`)
$ cargo supply-chain update
Note: this will download large amounts of data (approximately 250Mb).
On a slow network this will take a while.
thread 'main' panicked at 'Could not load patform certs: (None, Custom { kind: Other, error: Error { code: -25262, message: "The Trust Settings Record was corrupted." } })', /Users/eden/.cargo/registry/src/github.com-1ecc6299db9ec823/ureq-2.0.2/src/stream.rs:320:50
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
$ RUST_BACKTRACE=1 cargo supply-chain update
Note: this will download large amounts of data (approximately 250Mb).
On a slow network this will take a while.
thread 'main' panicked at 'Could not load patform certs: (None, Custom { kind: Other, error: Error { code: -25262, message: "The Trust Settings Record was corrupted." } })', /Users/eden/.cargo/registry/src/github.com-1ecc6299db9ec823/ureq-2.0.2/src/stream.rs:320:50
stack backtrace:
   0: rust_begin_unwind
             at /rustc/152f6609246558be5e2582e67376194815e6ba0d/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/152f6609246558be5e2582e67376194815e6ba0d/library/core/src/panicking.rs:92:14
   2: core::option::expect_none_failed
             at /rustc/152f6609246558be5e2582e67376194815e6ba0d/library/core/src/option.rs:1300:5
   3: core::ops::function::FnOnce::call_once
   4: once_cell::imp::OnceCell<T>::initialize::{{closure}}
   5: once_cell::imp::initialize_inner
   6: once_cell::imp::OnceCell<T>::initialize
   7: ureq::stream::connect_https
   8: ureq::unit::connect_socket
   9: ureq::unit::connect_inner
  10: ureq::unit::connect
  11: ureq::request::Request::do_call
  12: ureq::request::Request::call
  13: cargo_supply_chain::crates_cache::CratesCache::download
  14: cargo_supply_chain::subcommands::update::update
  15: cargo_supply_chain::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

publishers and crates commands report the same.

Shnatsel commented 3 years ago

Thank you for the report!

For a start, could you clone the repository locally, drop the "native-certs", part from this line in Cargo.toml, and see if it works then?

https://github.com/rust-secure-code/cargo-supply-chain/blob/77812b1fd591dc05723795a61b68d1ed8c9e2286/Cargo.toml#L18

You can invoke it via target/release/cargo-supply-chain when built from source. This should produce a functional build.

Shnatsel commented 3 years ago

I suspect this is an issue with https://github.com/ctz/rustls-native-certs; if the above steps resolve it, we'll need to report the issue to the maintainers of rustls-native-certs.

trevyn commented 3 years ago

could you clone the repository locally, drop the "native-certs", part from this line in Cargo.toml, and see if it works then?

Yep, this works, thanks!

(Also, I did cargo install --path ., which worked great)

Shnatsel commented 3 years ago

Looks like https://github.com/ctz/rustls-native-certs is the culprit, could you report this issue to them as well?