Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Openssl still pointing to LibreSSL 2.8.3

Tags:

macos

openssl

In my mac version 10.15.5, openssl is still pointing to LibreSSL 2.8.3. I have used the below commands, but no luck

homebrew install libressl

After installation when I ran the version command it is still showing LibreSSL 2.8.3 Also below command is throwing error -

brew link --force openssl                                                
Warning: Refusing to link macOS provided/shadowed software: [email protected]
If you need to have [email protected] first in your PATH run:
  echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc

For compilers to find [email protected] you may need to set:
  export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
  export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
like image 295
Sudipta Deb Avatar asked Jun 04 '20 13:06

Sudipta Deb


2 Answers

You may already have this working. To test run: which openssl

Further, running this will advise which version is the default: openssl version

To change to the homebrew version you need to add it into the path before the default. To do this, edit the startup script for your shell (which it seems in your case is zsh). So in your case edit ~/.zshrc with your favourite text editor or something like: nano ~/.zshrc

(for the default bash shell, use nano ~/.bashrc)

Insert a command to add the path to the brew installed openssl using this line, preferably somewhere near the top of the file:

export PATH="/usr/local/opt/[email protected]/bin:$PATH"

(At time of writing the most recent version of openssl has moved onto 1.1.1, so it may need to look like this now export PATH="/usr/local/opt/[email protected]/bin:$PATH")

Then "reload" the zsh startup script with this command:

source ~/.zshrc

You should now be seeing openssl 1.1 (no longer libressl) when running which openssl or openssl version

like image 89
Roy Verrips Avatar answered Sep 17 '22 16:09

Roy Verrips


So for me, openssl version used to be LibreSSL 2.8.3. Doing export PATH="/usr/local/opt/[email protected]/bin:$PATH" only got it to show OpenSSL 1.1.1i in the terminal, and also which openssl gives me the right command, but it still doesn't work.

So then adding the line export PATH="/usr/local/opt/[email protected]/bin:$PATH" inside ~/.profile worked.

Not ~/.bash_profile if you are using bash, or ~/.zshrc, or /etc/paths.

like image 24
Onion Avatar answered Sep 19 '22 16:09

Onion