MacOS – How to upgrade the openssl? A symlink isn’t working for /usr/local/bin/OpenSSL

homebrewmacosopensslrubysymlink

I'm having trouble updating my version of openssl so I can get Fastlane working.

Can anyone explain where OpenSSL should be, and how different environments hook into it?

MACOS:~ lamont$ openssl version
OpenSSL 0.9.8zh 14 Jan 2016
MACOS:~ lamont$ ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
OpenSSL 1.0.2k  26 Jan 2017
MACOS:~ lamont$ rm /usr/local/bin/openssl
rm: /usr/local/bin/openssl: No such file or directory
MACOS:~ lamont$ cd /usr/local/Cellar/openssl
MACOS:openssl lamont$ ls
1.0.2k
MACOS:openssl lamont$ sudo ln -s /usr/local/Cellar/openssl/1.0.2k/bin/openssl /usr/local/bin/openssl
Password:
MACOS:openssl lamont$ which openssl
/usr/local/bin/openssl
MACOS:openssl lamont$ openssl version
OpenSSL 0.9.8zh 14 Jan 2016
MACOS:openssl lamont$ 

Best Answer

If you run

brew info openssl

you will have the answer :

This formula is keg-only, which means it was not symlinked into /usr/local, because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

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