Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No usable OpenSSL found #82

mschae opened this issue Aug 17, 2018 · 10 comments

No usable OpenSSL found #82

mschae opened this issue Aug 17, 2018 · 10 comments


Copy link

@mschae mschae commented Aug 17, 2018

I get the following warnings/errors when trying to install erlang 21.0:

 * crypto         : No usable OpenSSL found
 * ssh            : No usable OpenSSL found
 * ssl            : No usable OpenSSL found

I'm on MacOS 10.13.6, updated asdf-erlang and have openssl installed via homebrew:

% brew ls --versions openssl
openssl 1.0.2o_1 1.0.2p 1.0.2o_2

Any ideas?

Copy link

@Stratus3D Stratus3D commented Aug 20, 2018

I'm not sure. Do you happen to have OpenSSL installed via some other method? It's possible you have some brew installed versions and one version that was installed manually by something else. Maybe kerl found the other installation first and realized it was not suitable for Erlang?

Copy link

@ddresselhaus ddresselhaus commented Aug 25, 2018

Ran into the same thing. Ended up just passing a valid openssl location to the --with-ssl flag into the build options.

At the end of the day, the KERL_CONFIGURE_OPTIONS line in my .zshrc file looked like this:
export KERL_CONFIGURE_OPTIONS="--disable-debug --disable-silent-rules --without-javac --enable-shared-zlib --enable-dynamic-ssl-lib --enable-hipe --enable-sctp --enable-smp-support --enable-threads --enable-kernel-poll --enable-wx --enable-darwin-64bit --with-ssl=/usr/local/Cellar/openssl/1.0.2p"

Also, I forgot to source it, which wasted even more time.

Copy link

@Stratus3D Stratus3D commented Aug 27, 2018

Thanks for sharing @ddresselhaus. Closing this issue since I don't believe it's due to a bug in asdf-erlang.

@Stratus3D Stratus3D closed this Aug 27, 2018
pdgonzalez872 added a commit to pdgonzalez872/asdf-erlang that referenced this issue Sep 26, 2019
Document the OpenSSL issue we have seen here:

- asdf-vm#82
- asdf-vm#105

Solution: comment by @ddresselhaus:
asdf-vm#82 (comment)

Also discussed in `kerl`:
kerl/kerl#320 (comment)

Closes asdf-vm#112
Closes asdf-vm#105
Copy link

@dirkholzapfel dirkholzapfel commented Sep 27, 2019

I could not get it to work with openssl 1.0.X, compilation with 1.1.X worked with the snippet of @ddresselhaus


Copy link

@javadba javadba commented Dec 27, 2019

This same issue also happens on Ubuntu 18.0.4

Update: this was fixed by doing

apt-get install -Y libssl-dev

Copy link

@layeddie layeddie commented Feb 22, 2020

I fixed this by uninstalling erlang with asdf
asdf uninstall erlang 22.2.7
then checking what version of openssl was under
ls /usr/local/Cellar/openssl
export KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=/usr/local/Cellar/openssl/1.0.2q"
asdf install erlang 22.2.7

sevenseacat added a commit to sevenseacat/dotfiles that referenced this issue Apr 20, 2020
Copy link

@pmarreck pmarreck commented May 27, 2020

I just spent a few hours troubleshooting this problem until someone else in Slack kindly pointed me to this issue. I'd still consider this a bug since

  1. I am not an SSL dev and I shouldn't have to concern myself with configuring this dependency manually, I want it to "just work"
  2. Installing a package should either A) install ALL needed dependencies OR B) alert you to the important ones that are missing and explain how to fix the situation or at least point you in the right direction. Now, asdf DID say "No usable OpenSSL found", but due to the relatively recent increase in importance of this functionality (since, for example, pretty much every API call is now over HTTPS), this should error, not warn, IMHO.

FWIW, as of today (May 27, 2020), with openssl managed by Homebrew, the following line added to my .envrc (I use direnv to manage env vars on a per-project and/or global basis) worked, and should also keep pace when a new version of openssl is installed (one less thing to worry about!):

export KERL_CONFIGURE_OPTIONS="--disable-debug --disable-silent-rules --without-javac --enable-shared-zlib --enable-dynamic-ssl-lib --enable-hipe --enable-sctp --enable-smp-support --enable-threads --enable-kernel-poll --enable-wx --enable-darwin-64bit --with-ssl=$(brew --prefix openssl)"

Copy link

@synalysis synalysis commented Jun 2, 2020

This worked for me (Erlang/OTP 23.0):
asdf plugin-update erlang

Copy link

@justingamble justingamble commented Jul 26, 2020

I fixed this by uninstalling erlang with asdf
asdf uninstall erlang 22.2.7
then checking what version of openssl was under
ls /usr/local/Cellar/openssl
export KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=/usr/local/Cellar/openssl/1.0.2q"
asdf install erlang 22.2.7

Thanks @layeddie ! Your post is what finally got me over the hurdle.

As well, I suspect that I previously did not install openssh correctly. In case it helps others, I'll give all the commands/changes that I executed on my mac (version 10.15.6):

asdf uninstall erlang 23.0.2
brew reinstall openssl@1.1 /* NOTE: openssl 1.1 was previously already installed on my machine */

Interestingly, the brew reinstall output included some tips which seem relevant:

If you need to have openssl@1.1 first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> /Users/[username]/.bash_profile

For compilers to find openssl@1.1 you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"

For pkg-config to find openssl@1.1 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"

To apply the above, I added the following to my .bashrc:
(the KERL_CONFIGURE_OPTIONS was copied from @layeddie 's and @ddresselhaus 's posts)

export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib $LDFLAGS"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include $CPPFLAGS"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig:$PKG_CONFIG_PATH"
export KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=/usr/local/Cellar/openssl@1.1/1.1.1g"

Then I re-installed Erlang and Elixir, and now all works fine for me:

asdf install erlang 23.0.3 /* NOTE: version bump since I originally installed 23.0.2 */
asdf install elixir 1.10.4

I became curious: was it only the change to KERL_CONFIGURE_OPTIONS that is important? Or is it also important to follow the instructions from homebrew regarding openssh? To test, I uninstalled Erlang/Elixir again, ran unset KERL_CONFIGURE_OPTIONS in that shell, and when I re-installed Erlang/Elixir in the same shell.. everything still worked correctly for me.

In short, my guess is that when I installed/upgraded openssl with homebrew, I probably ignored the output and did not setup LDFLAGS, CPPFLAGS, and PKG_CONFIG_PATH environment variables correctly. And then when I installed the latest Erlang, it could not find OpenSSL. It appears there are 2 workarounds: 1) install openssl correctly, or 2) use the KERL_CONFIGURE_OPTIONS environment variable. Or do both. :-)

Copy link

@alexnum alexnum commented Aug 18, 2020

For me on Ubuntu 18.04 the following worked:
sudo apt install libssl-dev
When, added the following --with-ssl to the KERL_CONFIGURE_OPTIONS envvar
export KERL_CONFIGURE_OPTIONS=" --with-ssl=/usr/lib/x86_64-linux-gnu/"
Then after that just ran the kerl build normally....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
10 participants