How to set the default LibreSSL on Mac to the one installed by homebrew

wh41e picture wh41e · Mar 8, 2019 · Viewed 13.1k times · Source

I checked the version of LibreSSL on my mac, it's not the latest one.

$ openssl version
LibreSSL 2.6.5

And I installed a more recent version by homebrew

homebrew install libressl

The one installed by homebrew is 2.8.3. But after I installed the new one and typed in the terminal openssl version, it still showed LibreSSL 2.6.5, which means the new one had not been set as the default.

I know that homebrew has a different installation path. But I don't know how to set the path as the default path for the LibreSSL. How to set the latest version of LibreSSL as the default one in Mac? Can anyone give me some suggestions?

Answer

Ortomala Lokni picture Ortomala Lokni · Mar 9, 2019

If you want the Homebrew version of LibreSSL as the default, you have to put it first in the PATH environment variable. If you type:

brew info libressl

You will obtain the command needed to do that:

If you need to have libressl first in your PATH run:
  echo 'export PATH="/usr/local/opt/libressl/bin:$PATH"' >> ~/.bash_profile