I\'m using MacOS X 10.7.5 and I need a newer OpenSSL version due to handshake failures. There are several tutorials on the internet and I tried the following:
If you're using Homebrew /usr/local/bin should already be at the front of $PATH
or at least come before /usr/bin. If you now run brew link --force openssl
in your terminal window, open a new one and run which openssl
in it. It should now show openssl
under /usr/local/bin.
https://guide.macports.org/
sudo port install openssl
or sudo port upgrade openssl
openssl version
to see the result.I had this issue and found that the installation of the newer openssl
did actually work, but my PATH
was setup incorrectly for it -- my $PATH
had the ports path placed before my brew path so it always found the older version of openssl
.
The fix for me was to put the path to brew
(/usr/local/bin) at the front of my $PATH
.
To find out where you're loading openssl
from, run which openssl
and note the output. It will be the location of the version your system is using when you run openssl
. Its going to be somewhere other than the brew
path of "/usr/local/bin". Change your $PATH
, close that terminal tab and open a new one, and run which openssl
. You should see a different path now, probably under /usr/local/bin. Now run openssl version
and you should see the new version you installed "OpenSSL 1.0.1e 11 Feb 2013".
On mac OS X Yosemite, after installing it with brew it put it into
/usr/local/opt/openssl/bin/openssl
But kept getting an error "Linking keg-only openssl means you may end up linking against the insecure" when trying to link it
So I just linked it by supplying the full path like so
ln -s /usr/local/opt/openssl/bin/openssl /usr/local/bin/openssl
Now it's showing version OpenSSL 1.0.2o when I do "openssl version -a", I'm assuming it worked
I had problems installing some Wordpress plugins on my local server running php56 on OSX10.11. They failed connection on the external API over SSL.
Installing openSSL didn't solved my problem. But then I figured out that CURL also needed to be reinstalled.
This solved my problem using Homebrew.
brew rm curl && brew install curl --with-openssl
brew uninstall php56 && brew install php56 --with-homebrew-curl --with-openssl
In a terminal, run:
export PATH=/usr/local/bin:$PATH
brew link --force openssl
You may have to unlink openssl first if you get a warning: brew unlink openssl
This ensures we're linking the correct openssl for this situation. (and doesn't mess with .profile)
Hat tip to @Olaf's answer and @Felipe's comment. Some people - such as myself - may have some pretty messed up PATH vars.