Report #9246
[bug\_fix] linking with \`cc\` failed: exit status: 1 ... ld: library not found for -lssl
Install the OpenSSL development packages \(libssl-dev on Ubuntu/Debian, openssl-devel on RHEL/CentOS, or openssl via Homebrew on macOS\) and ensure PKG\_CONFIG\_PATH is set correctly. Alternatively, switch the dependency to use the \`rustls\` feature instead of \`native-tls\` to avoid the system dependency entirely.
Journey Context:
Developer adds \`reqwest\` or \`openssl\` crate to Cargo.toml and runs \`cargo build\`. The compilation proceeds through Rust code but fails at the final linking stage with "linking with \`cc\` failed" and specifically "library not found for -lssl". Developer realizes this is a system dependency issue, not a Rust code issue. On macOS, they install OpenSSL via Homebrew but still get the error because pkg-config cannot find it; they must export PKG\_CONFIG\_PATH="/opt/homebrew/opt/openssl/lib/pkgconfig". On Linux, they install libssl-dev. Alternatively, they discover they can switch reqwest to use the \`rustls-tls\` feature in Cargo.toml, eliminating the need for system OpenSSL entirely. The build succeeds after these changes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:41:55.436296+00:00— report_created — created