$ exa -1 /usr/lib64 | rg "ssl|crypto"
libssl.so -> libssl.so.1.1.0g
libssl.so.1.0.2m
libssl.so.1.1 -> libssl.so.1.1.0g
libssl.so.1.1.0g
libssl.so.10 -> libssl.so.1.0.2m
libssl3.so
libcrypto.so -> libcrypto.so.1.1.0g
libcrypto.so.1.0.2m
libcrypto.so.1.1 -> libcrypto.so.1.1.0g
libcrypto.so.1.1.0g
libcrypto.so.10 -> libcrypto.so.1.0.2m
libcryptopp.so.6 -> libcryptopp.so.6.0.0
libcryptopp.so.6.0.0
// and a few more
$ cargo clean
$ cargo build
/// snip
Compiling csv v1.0.0-beta.5
error: could not find native static library `ssl`, perhaps an -L flag is missing?
error: Could not compile `openssl-sys`.
warning: build failed, waiting for other jobs to finish...
error: build failed
You need a statically compiled openssl library in the first place. Most default packages on distributions don't have that, so you need to look for either another package doing this or compiling openssl manually to a static library.
As the exa command showed you, there is no static build for ssl and crypto. You need to compile it yourself and point OPENSSL_LIB_DIR and OPENSSL_INCLUDE_DIR to it.
= note: /home/f/Projects/myapp/target/debug/deps/libopenssl_sys-eb87722056d2a428.rlib(c_zlib.o): In function `zlib_stateful_expand_block':
(.text+0x3b): undefined reference to `inflate'
/home/f/Projects/myapp/target/debug/deps/libopenssl_sys-eb87722056d2a428.rlib(c_zlib.o): In function `zlib_stateful_compress_block':
(.text+0xa4): undefined reference to `deflate'
/home/f/Projects/myapp/target/debug/deps/libopenssl_sys-eb87722056d2a428.rlib(c_zlib.o): In function `zlib_stateful_finish':
(.text+0xd9): undefined reference to `inflateEnd'
(.text+0xe2): undefined reference to `deflateEnd'
/home/f/Projects/myapp/target/debug/deps/libopenssl_sys-eb87722056d2a428.rlib(c_zlib.o): In function `zlib_stateful_init':
(.text+0x1a8): undefined reference to `inflateInit_'
(.text+0x21a): undefined reference to `deflateInit_'
/home/f/Projects/myapp/target/debug/deps/libopenssl_sys-eb87722056d2a428.rlib(c_zlib.o): In function `bio_zlib_ctrl':
(.text+0x3dc): undefined reference to `deflate'
(.text+0x5a4): undefined reference to `zError'
/home/f/Projects/myapp/target/debug/deps/libopenssl_sys-eb87722056d2a428.rlib(c_zlib.o): In function `bio_zlib_write':
(.text+0x6b0): undefined reference to `deflate'
(.text+0x76c): undefined reference to `zError'
(.text+0x7df): undefined reference to `deflateInit_'
/home/f/Projects/myapp/target/debug/deps/libopenssl_sys-eb87722056d2a428.rlib(c_zlib.o): In function `bio_zlib_read':
(.text+0x8c8): undefined reference to `inflate'
(.text+0x944): undefined reference to `zError'
(.text+0x9c5): undefined reference to `inflateInit_'
/home/f/Projects/myapp/target/debug/deps/libopenssl_sys-eb87722056d2a428.rlib(c_zlib.o): In function `bio_zlib_free':
(.text+0xa35): undefined reference to `inflateEnd'
(.text+0xa60): undefined reference to `deflateEnd'
collect2: error: ld returned 1 exit status
This might not be exactly what you're looking for, but @japaric has a repo that discusses how to get OpenSSL to cross compile (I presume statically): https://github.com/japaric/cross
Unfortunately no. Once crypt and ssl are linked, the next level is zlib which seems to be a bit more nasty since it is dependency of the C library but not of the rust crate.