Skip to content

Commit

Permalink
Fix build on FreeBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Sep 2, 2024
1 parent 36777b0 commit 3b98885
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions rustls-platform-verifier/src/tests/verification_mock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@ pub(super) fn verification_without_mock_root() {
// runner fails to find any roots with openssl-probe we need to provide webpki-root-certs here
// or the test will fail with the `OtherError` instead of the expected `CertificateError`.
#[cfg(target_os = "freebsd")]
let verifier =
Verifier::new_with_extra_roots(webpki_root_certs::TLS_SERVER_ROOT_CERTS.iter().cloned());
let verifier = Verifier::new_with_extra_roots(
webpki_root_certs::TLS_SERVER_ROOT_CERTS
.iter()
.cloned()
.collect(),
);

#[cfg(not(target_os = "freebsd"))]
let verifier = Verifier::new();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,12 @@ fn real_world_test<E: std::error::Error>(test_case: &TestCase<E>) {
// On BSD systems openssl-probe fails to find the system CA bundle,
// so we must provide extra roots from webpki-root-cert.
#[cfg(target_os = "freebsd")]
let verifier =
Verifier::new_with_extra_roots(webpki_root_certs::TLS_SERVER_ROOT_CERTS.iter().cloned());
let verifier = Verifier::new_with_extra_roots(
webpki_root_certs::TLS_SERVER_ROOT_CERTS
.iter()
.cloned()
.collect(),
);

#[cfg(not(target_os = "freebsd"))]
let verifier = Verifier::new();
Expand Down

0 comments on commit 3b98885

Please sign in to comment.