Execute following commands:
brew update
brew install openssl
echo ‘export PATH=”/usr/local/opt/openssl/bin:$PATH”‘ >> ~/.bash_profile
source ~/.bash_profile
You will have the latest version of openssl installed and accessible from cli (command line/terminal). Since the third command will add export path to .bash_profile, the newly installed version of openssl will be accessible across system restarts.
Only
export PATH=$(brew –prefix openssl)/bin:$PATH in ~/.bash_profile
has worked for me!
Thank you mipadi.