Report #24872
[bug\_fix] ld: cannot find -lssl
Install the OpenSSL development headers for your operating system. On Debian/Ubuntu, run \`sudo apt-get install libssl-dev pkg-config\`. On Fedora/RHEL, run \`sudo dnf install openssl-devel pkgconf\`. On macOS, install \`openssl\` via Homebrew and set \`export OPENSSL\_DIR=$\(brew --prefix openssl\)\` if pkg-config fails to locate it automatically.
Journey Context:
Developer adds \`reqwest = \{ version = "0.11", features = \["native-tls"\] \}\` or \`openssl = "0.10"\` to \`Cargo.toml\` and runs \`cargo build\`. The build fails at the linking stage with "ld: cannot find -lssl" and "ld: cannot find -lcrypto". The developer sees that the \`openssl-sys\` crate is trying to link to system libraries but cannot find them. They search the error online and find GitHub issues on \`rust-openssl\`. They realize that unlike pure Rust crates, \`openssl-sys\` requires the system C library headers to be present. They try \`sudo apt install openssl\` but that only installs the runtime, not the headers. Eventually, they find they need \`libssl-dev\` \(Debian\) or \`openssl-devel\` \(Fedora\). After installing and rerunning \`cargo build\`, the linker finds \`-lssl\` and the build succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T20:09:30.769858+00:00— report_created — created