Skip to content

Commit 7c37600

Browse files
authored
Configure --openssldir to its default location (#141) (#142)
As pointed out in #140 otherwise certificates and configure is by default looked up in the directory of the build machine itself which is often a writable path. Instead switch the configuration option back to the default recommended in openssl's `INSTALL.md` Closes #140
1 parent 24f3ff4 commit 7c37600

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/lib.rs

+11
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,23 @@ impl Build {
135135
env::var("OPENSSL_SRC_PERL").unwrap_or(env::var("PERL").unwrap_or("perl".to_string()));
136136
let mut configure = Command::new(perl_program);
137137
configure.arg("./Configure");
138+
139+
// Change the install directory to happen inside of the build directory.
138140
if host.contains("pc-windows-gnu") {
139141
configure.arg(&format!("--prefix={}", sanitize_sh(&install_dir)));
140142
} else {
141143
configure.arg(&format!("--prefix={}", install_dir.display()));
142144
}
143145

146+
// Specify that openssl directory where things are loaded at runtime is
147+
// not inside our build directory. Instead this should be located in the
148+
// default locations of the OpenSSL build scripts.
149+
if target.contains("windows") {
150+
configure.arg("--openssldir=SYS$MANAGER:[OPENSSL]");
151+
} else {
152+
configure.arg("--openssldir=/usr/local/ssl");
153+
}
154+
144155
configure
145156
// No shared objects, we just want static libraries
146157
.arg("no-dso")

0 commit comments

Comments
 (0)