How to update OpenSSL lib on OSX


Last night one of my CI builds ran into error by executing CMake based build with following error message:

Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system 
variable OPENSSL_ROOT_DIR: Found unsuitable version "0.9.8y", but required is at least "1.0.0"

Running following command to get current version of installed OpenSSL

$ openssl version -a

Gave me 

Even though build was pretty recent the version number was still lower from that what I needed.

Since I am using Homebrew as package manager I could install newer version with following command.

$ brew install openssl

This however, downloads and builds OpenSSL into Homebrew local folder and does not change symlinks for currently installed version. Running the following command should update symlinks in /usr/bin

$ brew link openssl --force

But running the

$ openssl version -a
Showed the same version again so I had to update symlinks manually.

$ sudo ln -s /usr/local/Cellar/openssl/1.0.2d_1/bin/openssl /usr/bin

If you are running latest version of OSX (10.11.1 El Capitan at this moment) chances are that "System Integrity Protection" is enabled thus not allowing you to edit content under /usr/bin. You can check if this protection is enabled by running 

$ csrutil status


If this protection is enabled here you can read about how to disable it before executing these commands.

About me

Bizic Bojan is Freelance Software Development Consultant with focus on C++, Qt and .NET based software solutions development. 

 

Disclaimer:

The opinions expressed herein are my own personal opinions and do not represent my employer’s view in any way.

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.