examples icon indicating copy to clipboard operation
examples copied to clipboard

[improvement] running rustls-server from workspace panics

Open efx opened this issue 4 years ago • 0 comments

As a cargo user, I expect to be able to run packages from a cargo workspace.

  1. I ran:
cargo run  --bin rustls-server

It errored with:

   Running `target/debug/rustls-server`
Started http server: 127.0.0.1:8443
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', security/rustls/src/main.rs:28:64

improvement guide

The following lines load the key pair: https://github.com/actix/examples/blob/d3543e541358301da2450f07aabaf5f0ec856a2e/security/rustls/src/main.rs#L28-L29 They expect the key files to be in the current directory but they are not. An improvement would be to resolve those files dynamically. Consider updating those lines to avoid using unwrap too.

efx avatar Aug 24 '21 16:08 efx