new to rust, I am trying to build a dummy reverse proxy with tokio and axum, you can find it here. While putting things together, I stumble in this error:
error: linking with `cc` failed: exit status: 1
|
...
= note: /usr/bin/ld: /home/fpezzati/workspace/keymaster/target/debug/deps/libreqwest-ca3141de8b4ae515.rlib(reqwest-ca3141de8b4ae515.reqwest.5838258711064664-cgu.12.rcgu.o): in function `openssl::ssl::SslStream<S>::ssl_read_uninit':
/home/fpezzati/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-0.10.64/src/ssl/mod.rs:3786: undefined reference to `SSL_read_ex'
...
/usr/bin/ld: /home/fpezzati/workspace/keymaster/target/debug/deps/libopenssl_sys-661b9af21fb0f20e.rlib(openssl_sys-661b9af21fb0f20e.openssl_sys.47e9ab06f8f5ff97-cgu.0.rcgu.o): in function `openssl_sys::openssl::ssl::SSL_CTX_set_max_proto_version':
/home/fpezzati/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.102/src/./ssl.rs:468: undefined reference to `SSL_CTX_ctrl'
collect2: error: ld returned 1 exit status
= note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)
warning: `keymaster` (bin "keymaster") generated 6 warnings
error: could not compile `keymaster` (bin "keymaster") due to 1 previous error; 6 warnings emitted
It looks like something’s wrong with my openssl
and reqwest
crate (they both appear in output), but I don’t get what and cannot find any solution to this issue. I am trying to build this using rust 1.76, openssl 3.0.2 on a mint distro. I also tried to build the same on the latest rust docker image but I found other issues (cmake missing). I’ll also appreciate any hint about how to deal/debug this kind of errors, I am new to rust and to system programming in general. Thanks.
1