Question about OpenSSL 3.0 and static linking

Shunichi Shinohara shino.shun at
Tue Feb 22 06:37:03 UTC 2022

Hi List,

I have a question about OpenSSL 3.0 and static linking.

Short version: Is it possible to include the legacy provider in libcrypt.a?

Somewhat long version below.
As a background of the question I'm using OpenSSL with Erlang/OTP [1] on Linux
and want to static link OpenSSL library.  With OpenSSL 1.1.1, it works nice,
but I couldn't make it work well with OpenSSL 3.0.1.

Build steps:

 curl -LO
 tar xvfz openssl-3.0.1.tar.gz
 cd openssl-3.0.1
 ./config --prefix=$HOME/local/openssl-3.0.1 no-shared
 make -j && make install_sw

After Building Erlang/OTP with it and moving $HOME/local/openssl-3.0.1/lib64 to
$HOME/tmp, my (Erlang) code fails at OSSL_PROVIDER_load(NULL, "legacy"):

What I found are:
- there are two library files under $HOME/local/openssl-3.0.1/lib64, libcrypt.a
  and ossl-modules/, and
- if I pass the environment variable OPENSSL_MODULES=$HOME/tmp in
launching Erlang,
  all work well.

So, copying and adding an environment variable can be an option.
Before going with the option, I want to confirm whether including legacy in
libcrypt.a in possible or not.


Thanks in advance!

More information about the openssl-users mailing list