Commit 7f1d694
Merge #218
218: Fix wrong cert used in examples/client.rs r=Taowyoo a=weibin159
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:
```diff
- 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
Co-authored-by: Weibin <wwb159874@163.com>
Co-authored-by: YX Cao <caoyxsh@outlook.com>1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
0 commit comments