Email me

Rust errors / Build and Cargo

Rust build error · checked with Rust 1.99.0

error: failed to run custom build command for `openssl-sys`

error: failed to run custom build command for `openssl-sys`

What it meansThe openssl-sys crate links to the system OpenSSL library and could not find it (or pkg-config) on your machine.

Why it happens

  • OpenSSL development headers are not installed.
  • pkg-config is missing.
  • Cross-compiling, where the host OpenSSL does not match the target.

How to fix it

1. Install OpenSSL dev files

Debian/Ubuntu shown; Fedora uses openssl-devel, macOS uses brew install openssl@3.

sudo apt install pkg-config libssl-dev

2. Avoid OpenSSL entirely

Most HTTP crates can use rustls (pure Rust TLS) instead.

reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"] }

3. Build OpenSSL from source

The vendored feature compiles OpenSSL into your binary (needs perl and a C compiler); handy for cross-compiling.

openssl = { version = "0.10", features = ["vendored"] }

Other wordings of this error

failed to run custom build command for openssl-sys, Could not find directory of OpenSSL installation, openssl-sys build failed, pkg-config openssl not found

Other build errors

Up next

Find the right pagePaste any Rust errorCompiler codes and build errors in one finder.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ