Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set Openssl 1.1.1 as a default version

Tags:

macos

openssl

I have macOS BigSur 11.6. When I run openssl version I get

LibreSSL 2.8.3

What I want is to get this output:

OpenSSL 1.1.1l  24 Aug 2021

In the /usr/local/opt/ there are folders: openssl, openssl@3, [email protected].

I ran these commands:

brew install openssl
brew reinstall openssl@3
sudo ln -sfn /usr/local/Cellar/[email protected] /usr/local/opt/openssl

I placed the line export PATH="/usr/local/opt/[email protected]/bin:$PATH" in files ~/.profile, ~/.bash_profile, ~/bashrc.

But nothing helps. How can I make the default openssl version 1.1?

Plese, don't offer commands as in this or this questions. These commands don't change anything: as soon as I open a new session I get the same LibreSSL 2.8.3 instead of opessl 1.1.1l

export PATH="/usr/local/opt/[email protected]/bin:$PATH"
source ~/.profile
source ~/.bash_profile
source ~/.bashrc

UPD 1

  • type -a openssl shows:
openssl is /usr/bin/openssl
  • echo $PATH shows:
/usr/local/opt/libressl/bin:/usr/local/opt/[email protected]/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

UPD 2

Just made unset PATH, set in files ~/.profile, ~/.bash_profile, ~/bashrc the same line export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/[email protected]/bin:$PATH" and ran this line in bash. Anyway there is the same output for openssl version: LibreSSL 2.8.3.

  • this bash --norc -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin; set -x; source ~/.bash_profile' shows:
+ source /Users/sgalich/.bash_profile
++ export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/[email protected]/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
++ PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/[email protected]/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
++ export LDFLAGS=-L/usr/local/opt/[email protected]/lib
++ LDFLAGS=-L/usr/local/opt/[email protected]/lib
++ export CPPFLAGS=-I/usr/local/opt/[email protected]/include
++ CPPFLAGS=-I/usr/local/opt/[email protected]/include
++ export CPATH=/usr/local/opt/[email protected]/include
++ CPATH=/usr/local/opt/[email protected]/include
++ export LIBRARY_PATH=/usr/local/opt/[email protected]/lib
++ LIBRARY_PATH=/usr/local/opt/[email protected]/lib
++ export DYLD_LIBRARY_PATH=/usr/local/opt/[email protected]/lib
++ DYLD_LIBRARY_PATH=/usr/local/opt/[email protected]/lib
++ export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/opt/[email protected]/lib
++ DYLD_FALLBACK_LIBRARY_PATH=/usr/local/opt/[email protected]/lib
like image 762
sgalich Avatar asked Jul 01 '26 05:07

sgalich


2 Answers

On MacOS Monterey (with M1 chip) the paths differed.

I added the following to ~/.zshrc

export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"
like image 131
SverokAdmin Avatar answered Jul 02 '26 17:07

SverokAdmin


So the issue was in my PATH variable. My problem was solved after adding this line in the ~/.bash_profile:

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

Thanks @Gordon Davisson for the answer!

like image 33
sgalich Avatar answered Jul 02 '26 17:07

sgalich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!