Skip to content

Conversation

@weibin159
Copy link
Contributor

I got this error when trying to run the examples/client.rs

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: X509CertVerifyFailed', mbedtls/examples/client.rs:54:6
stack backtrace:
   0: rust_begin_unwind
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/panicking.rs:64:14
   2: core::result::unwrap_failed
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/result.rs:1791:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/result.rs:1113:23
   4: client::main
             at ./mbedtls/examples/client.rs:49:5
   5: core::ops::function::FnOnce::call_once
             at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/ops/function.rs:507:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

I found that it's because of using the wrong cert in examples/client.rs

Fix with:

-   let cert = Arc::new(Certificate::from_pem_multiple(keys::PEM_CERT.as_bytes())?);
+   let cert = Arc::new(Certificate::from_pem_multiple(keys::ROOT_CA_CERT.as_bytes())?);

Same as #123

@weibin159
Copy link
Contributor Author

The certificate used for unit testing has expired #219

@Taowyoo
Copy link
Collaborator

Taowyoo commented Mar 9, 2023

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 9, 2023

Build succeeded:

  • continuous-integration/travis-ci/push

@bors bors bot merged commit 7f1d694 into fortanix:master Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants