[macos] Update OpenSSL on OS X with Homebrew

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:

brew install openssl
brew link openssl --force

Nevertheless, it does not work:

openssl version
OpenSSL 0.9.8r 8 Feb 2011

brew unlink openssl && brew link openssl --force
Unlinking /usr/local/Cellar/openssl/1.0.1e... 1139 links removed
Linking /usr/local/Cellar/openssl/1.0.1e... 1139 symlinks created

The SVN issue is not resolved either. Any ideas? I would rather not try the MacPorts way because it may interfere with Homebrew.

This question is related to macos svn openssl homebrew

The answer is


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.


installed openssl on mac with brew but nothing found on /usr/local/bin where other brew installed bins are located. Found my fresh openssl here:

/usr/local/opt/openssl/bin/openssl

Run it like this:

/usr/local/opt/openssl/bin/openssl version

I don't want to update OS X openssl, while some OS stuff or other 3rd party apps may have dependency on older version.

I also don't mind longer path than just openssl

Writing this here for all the Googlers who are looking for location of openssl installed by brew.


  1. install port: https://guide.macports.org/
  2. install or upgrade openssl package: sudo port install openssl or sudo port upgrade openssl
  3. that's it, run 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 brewpath 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


To answer your question regarding updating openssl I followed these steps to successfully update the version found on my Mac to the newest openssl version 1.0.1e.

I followed the steps found here: http://foodpicky.com/?p=99

When you reach the steps for terminal commands make and make install be sure to use sudo make and sudo make install (I had to go through the step-by-step twice because I did it without sudo and it did not update).

Hope this helps


Examples related to macos

Problems with installation of Google App Engine SDK for php in OS X dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib error running php after installing node with brew on Mac Could not install packages due to an EnvironmentError: [Errno 13] How do I install Java on Mac OSX allowing version switching? Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) Can't compile C program on a Mac after upgrade to Mojave You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory. (mac user) How can I install a previous version of Python 3 in macOS using homebrew? Could not install packages due to a "Environment error :[error 13]: permission denied : 'usr/local/bin/f2py'"

Examples related to svn

Error "can't use subversion command line client : svn" when opening android project checked out from svn How to view changes made to files on a certain revision in Subversion Intellij idea subversion checkout error: `Cannot run program "svn"` How change default SVN username and password to commit changes? How to rename a file using svn? Connect Android Studio with SVN svn: E155004: ..(path of resource).. is already locked SVN Commit failed, access forbidden How to add an existing folder with files to SVN? Update OpenSSL on OS X with Homebrew

Examples related to openssl

dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib How to install OpenSSL in windows 10? SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 How to fix: fatal error: openssl/opensslv.h: No such file or directory in RedHat 7 Homebrew refusing to link OpenSSL Solving sslv3 alert handshake failure when trying to use a client certificate How to install latest version of openssl Mac OS X El Capitan How to resolve the "EVP_DecryptFInal_ex: bad decrypt" during file decryption SSL error SSL3_GET_SERVER_CERTIFICATE:certificate verify failed Can't get private key with openssl (no start line:pem_lib.c:703:Expecting: ANY PRIVATE KEY)

Examples related to homebrew

dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib error running php after installing node with brew on Mac How can I install a previous version of Python 3 in macOS using homebrew? SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 pip3: command not found env: node: No such file or directory in mac Stuck at ".android/repositories.cfg could not be loaded." Brew install docker does not include docker engine? What do raw.githubusercontent.com URLs represent? Homebrew refusing to link OpenSSL