hyper: openssl dependency doesn't work

Compiling openssl v0.7.4 Build failed, waiting for other jobs to finish… failed to run custom build command for openssl v0.7.4 Process didn’t exit successfully: /Users/reactor/Projects/r_gifts/target/debug/build/openssl-3ceab475d186eefe/build-script-build (exit code: 101) — stdout TARGET = Some(“x86_64-apple-darwin”) OPT_LEVEL = Some(“0”) PROFILE = Some(“debug”) TARGET = Some(“x86_64-apple-darwin”) debug=true opt-level=0 HOST = Some(“x86_64-apple-darwin”) TARGET = Some(“x86_64-apple-darwin”) TARGET = Some(“x86_64-apple-darwin”) HOST = Some(“x86_64-apple-darwin”) CC_x86_64-apple-darwin = None CC_x86_64_apple_darwin = None HOST_CC = None CC = None HOST = Some(“x86_64-apple-darwin”) TARGET = Some(“x86_64-apple-darwin”) HOST = Some(“x86_64-apple-darwin”) CFLAGS_x86_64-apple-darwin = None CFLAGS_x86_64_apple_darwin = None HOST_CFLAGS = None CFLAGS = None running: “cc” “-O0” “-ffunction-sections” “-fdata-sections” “-g” “-m64” “-fPIC” “-o” “/Users/reactor/Projects/r_gifts/target/debug/build/openssl-3ceab475d186eefe/out/src/c_helpers.o” “-c” “src/c_helpers.c” ExitStatus(Code(1))

command did not execute successfully, got: exit code: 1

— stderr src/c_helpers.c:1:10: fatal error: ‘openssl/ssl.h’ file not found

include <openssl/ssl.h>

     ^

1 error generated. thread ‘<main>’ panicked at ‘explicit panic’, /Users/reactor/.cargo/registry/src/github.com-0a35038f75765ae4/gcc-0.3.21/src/lib.rs:772

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 2
  • Comments: 22 (6 by maintainers)

Most upvoted comments

@kballard I’m close to publishing https://github.com/sfackler/rust-native-tls which should handle all of that and I believe we’ll be able to make the default SSL backend for hyper.

A workaround to link against openssl (installed with homebrew) is to use a custom .cargo/config:

[target.x86_64-apple-darwin.openssl]
libdir = "/usr/local/opt/openssl/lib"
include = "/usr/local/opt/openssl/include"

Anyway, using security-framework seems the way to go.

hyper = { version = "0.9", default-features = false, features = ["security-framework"] }

On Debian you should just install libssl-dev package and it will work, or just update libssl.

I hit this problem, found this issue, brew link openssl --force worked for me.