Installing OpenSSL library on macOS Catalina (2024)

Whether you are building apps for just macOS or for cross-platform, if your app is using OpenSSL for crypto-works, you will have to install OpenSSL library since macOS ships with LibreSSL. Furthermore, cross-platform cryptography in .Net Core and .Net 5 uses OpenSSL on macOS.

Installing OpenSSL library on macOS seems easy at first, but in practice can be a real pain in the back. Here is my journey of installing OpenSSL 1.1.1g on macOS Catalina (10.15.6) and making it reachable by my .Net Core apps. I tried to write complete and generalized instructions to be as applicable to more systems as possible. And I also avoided symbolic linking (ln -s) and install_name_tool, since for me those are last options.

Installing OpenSSL

First, open a terminal, and see if OpenSSL is already installed:

brew info openssl

If it’s not installed, you’ll see “Not installed” among the first few lines of output. Or may be it’s not the latest version. So, install or update if necessary:

brew install openssl
#or#
brew upgrade openssl

Check if the system sees the library directly:

openssl version -a

This command prints the SSL library which exists first in the PATH environment variable, being LibreSSL or OpenSSL at some version. OpenSSL doesn’t need being here to be reachable. But if you want this for some reason, follow the instructions below, otherwise jump to the Making OpenSSL Reachable section.

Run the command “brew info openssl” again:

Installing OpenSSL library on macOS Catalina (2)

Since OpenSSL is keg-only [1], it has to be referred from an environment variable, which is done by the printed instruction, which is the echo ‘export… line in the red rectangle at above screenshot. It may be a bit different in your system, it’s because it depends on its version. Copy/paste/run that line, so that necessary command will be written to .profile file [2].

To see what is written to .profile file, if you wonder, run below command at home directory:

nano .profile

Manually run the .profile file to eliminate logoff & logon at this time:

source ~/.profile

Check if system sees it now:

openssl version -a

It should now print the up-to-date OpenSSL.

Installing OpenSSL library on macOS Catalina (3)

Making OpenSSL Reachable

When an app wants to use a library, macOS searches several locations to find it. We have to find library path of OpenSSL and add it to DYLD_LIBRARY_PATH environment variable. For this purpose, run “brew info openssl” command again.

Installing OpenSSL library on macOS Catalina (4)

The path in the red rectangle at above screenshot is the path where OpenSSL is installed. To have the library path we’re looking for, just append /lib to it. We want this library path to be added to aforementioned environment variable at every user logon. And we’ll use below command for this, just replace the …/lib path with the one you have.

echo 'export DYLD_LIBRARY_PATH="/usr/local/Cellar/openssl@1.1/1.1.1g/lib:$DYLD_LIBRARY_PATH"' >> ~/.profile

Manually run the .profile file [2] to eliminate logoff & logon at this time:

source ~/.profile

This should do the trick normally. But I’ve read that on some systems apps still cannot find OpenSSL library. So, try running your OpenSSL app. If the app gives an error like “No usable version of libssl was found. Abort trap: 6” or “PlatformNotSupportedException”, you may have to install or update libssh2. I didn’t need it but here it is:

brew install libssh2
#or#
brew upgrade libssh2

Since libssh2 is not keg-only [1], it will be readily accessible without adding it to any environment variable.

That’s it! Now OpenSSL library should be reachable from any app. At least that’s the common hope 😊 This was not the funniest thing I did so far, but it was necessary. And I wrote it down here to be a reference for everyone.

I wish you installations funnier than this one 😁 Now I need some beer 🍺

Happy OpenSSLing!

Note [1]: For a software via brew to be “keg-only” means it is installed in /usr/local/Cellar but not linked into places like /usr/local/bin, /usr/local/lib. This means most tools will not find it.

Note [2]: .profile file (or .bash_profile, .bash_login) is something similar to autoexec.bat on Windows. Bash looks for it, and reads and executes commands in it, at user’s every logon.

Installing OpenSSL library on macOS Catalina (2024)

FAQs

How to install OpenSSL library in Mac? ›

We have to find library path of OpenSSL and add it to DYLD_LIBRARY_PATH environment variable. For this purpose, run “brew info openssl” command again. The path in the red rectangle at above screenshot is the path where OpenSSL is installed. To have the library path we're looking for, just append /lib to it.

What SSL library does macOS use? ›

OpenSSL is available for most Unix-like operating systems (including Linux, macOS, and BSD), Microsoft Windows and OpenVMS.

How do I know if OpenSSL is installed on my Mac? ›

The OpenSSL version that is being used by Mac OS X can be checked by typing "OpenSSL version" into a Terminal command prompt. If the results of running OpenSSL return "0.9.

How do I load Library on Mac? ›

How to Open the Library Folder on Your Mac
  1. Switch to the Finder.
  2. Press and hold down the Option key on the keyboard.
  3. From the Go menu, select Library, as shown below. The Library folder will open.
Jan 3, 2021

How to install OpenSSL step by step? ›

How To Install OpenSSL On The Windows Platform?
  1. Run the OpenSSL installer to install. Execute the downloaded installer file and install the OpenSSL on the Windows machine. ...
  2. Initiate installing OpenSSL. ...
  3. Installation in progress…….
  4. Complete the installation of OpenSSL. ...
  5. Set Environment variable. ...
  6. Run OpenSSL.

Is OpenSSL installed by default on Mac? ›

The first option is the simplest one: do nothing. macOS has shipped with OpenSSL preinstalled since 2000.

Where are OpenSSL libraries installed? ›

The command will install all the OpenSSL components in the directory specified in the --prefix option (/opt/openssl) and --openssldir option (/usr/local/ssl). The libraries are in the /opt/openssl/lib directory and the OpenSSL binary file is in the /opt/openssl/bin directory.

How to install SSL certificate in macOS? ›

For Web Services:
  1. Open Web > Sites.
  2. Choose the site you want to select the certificate onto.
  3. Click the Security tab and click the checkbox to Enable Secure Sockets Layer (SSL).
  4. Choose the certificate.
  5. At the prompt "Do you want to restart Web now?" Choose Restart.

How to build OpenSSL for Mac? ›

OpenSSL
  1. Get the Code. Switch to /usr/local/src and download the source package. ...
  2. Compile and Install. Configure, compile and install into /usr/local/mac-dev-env/openssl-1.1. ...
  3. Shell. Execute the following lines to update your Bash startup script. ...
  4. Certificates. ...
  5. Verify the Installation.

How does OpenSSL get installed? ›

How To Install OpenSSL on Windows
  1. Step 1 – Download OpenSSL Binary. You need to download the latest OpenSSL windows installer file. ...
  2. Step 2 – Run OpenSSL Installer. Now run the OpenSSL installer on your system. ...
  3. Step 3 – Setup Environment Variables. ...
  4. Step 4 – Run OpenSSL Binary.
Aug 9, 2022

How to update OpenSSL library? ›

Please find the below steps to update openssl on your server:
  1. Check your openssl version. # openssl version. ...
  2. Download the latest version of openssl from: http://www.openssl.org/source/ ...
  3. Extract openssl-1.0.1g.tar.gz. Go to openssl-1.0.1g directory. ...
  4. Done.
  5. Check the if you you have the latest version.

What version of OpenSSL does macOS use? ›

1): Installing OpenSSL library on macOS Catalina. The "newer" version (LibreSSL 2.8. 3) actually comes with macOS out of the box (note that macOS switched to using LibreSSL some time ago).

Does OpenSSL work on Mac? ›

OpenSSL overview

Note that OpenSSL is officially available only as source, so you must manually compile and install the software on your Mac.

What is latest version of OpenSSL for Mac? ›

Note: The latest stable version is the 3.1 series supported until 14th March 2025. Also available is the 3.0 series which is a Long Term Support (LTS) version and is supported until 7th September 2026. The previous LTS version (the 1.1.1 series) is also available and is supported until 11th September 2023.

How do I access my Library on Mac Catalina? ›

How to find Library folder on Mac (macOS Sierra, Mojave or Catalina)
  1. Open Finder.
  2. Click Go in the menu bar and select Go to Folder. Or use the Cmd+Shift+G key shortcut.
  3. Type ~/Library and press Return (Enter) in the search panel.
  4. The user Library folder will be shown.
May 5, 2023

What is the Library file on Mac? ›

Library. This folder contains fonts and other items used by apps that are available to all users of your Mac. Don't use the Library folder to store files and folders you create. Instead, use the home folder, the Desktop folder, the Documents folder, or iCloud Drive.

Is there a Library app for Mac? ›

Library Books is now a free download. Return your library books on time. Never pay a fine again. Track the books you have on loan.

How to install OpenSSL without sudo? ›

Installing OpenSSL
  1. Log into your server via SSH.
  2. Once both files are downloaded, view the checksum to confirm the version you downloaded is safe to use. ...
  3. Decompress this file. ...
  4. Change into the new openssl directory. ...
  5. Configure the file: ...
  6. Run make. ...
  7. Run make install. ...
  8. Change back to your home directory.
Jun 13, 2022

What is the first step of OpenSSL? ›

The first step to obtaining an SSL certificate is using OpenSSL to create a certificate signing request (CSR) that can be sent to a Certificate Authority (CA) (e.g., DigiCert). The CSR contains the common name(s) you want your certificate to secure, information about your company, and your public key.

How to run OpenSSL in command? ›

To run the program, go to the C:\OpenSSL-Win32\bin directory and double-click the file openssl.exe. This opens a text window with an OpenSSL> prompt.

How do I update OpenSSL on Mac? ›

How to Update OpenSSL on an Apple
  1. Click on the Apple icon on your Mac screen.
  2. Click "Software Update..." from the drop-down menu to launch the "Checking for New Software" dialog box.
  3. Update either OpenSSL or your entire your computer, if required.

How to install OpenSSL in terminal? ›

WARNING: can't open config file: /usr/local/ssl/openssl.cnf
  1. Close OpenSSL.
  2. Open a Command Prompt (CMD) as Administrator.
  3. Run the following command: SET OPENSSL_CONF=C:\OpenSSL-Win32\bin\openssl. cfg.
  4. Reboot the computer.

Where are SSL stored on Mac? ›

In macOS, certificates are part of your digital identity and are stored in your keychain. Keychain Access lets you manage your certificates and keychains.

Where are ssl libraries stored? ›

File replacement

In the default configuration, the drivers use the OpenSSL library file located in the \drivers subdirectory for Windows installations and the /lib subdirectory for UNIX/Linux.

Where are shared libraries installed? ›

In this standard, folders /lib, /usr/lib and /usr/local/lib are the default folders to store shared libraries. The /lib folder has libraries used during the boot time of the system but also used by programs in the /bin folder. Similarly, the/usr/lib folder has libraries used by programs in the /usr/bin folder.

Where is my OpenSSL folder? ›

The OpenSSL configuration file is located at /etc/ssl/openssl.

How do I fix SSL certificate error on Mac? ›

Clear your cache and cookies.

If your system time was already correct, you can often resolve SSL errors by deleting certain files that websites save to your computer. Clearing your cookies, as well as clearing your cache, can fix a wide variety of browsing errors in addition to certificate malfunctions.

How do I manually install an SSL certificate? ›

How To Manually install an SSL Certificate
  1. Step 1: Purchase an SSL Certificate.
  2. Step 2: Configure your SSL Certificate.
  3. Step 3: Generate and upload a CSR.
  4. Step 4: Verify certificate details and click “Proceed.”
  5. Step 5: Allow time for the certificate to validate.
Oct 17, 2020

How do I verify an SSL certificate on a Mac? ›

In the Keychain Access app on your Mac, click Certificates in the Category list, then double-click the certificate you want to evaluate. Choose Keychain Access > Certificate Assistant > Evaluate [certificate name].

How do I add a Library folder to my Mac? ›

Access the Library folder in Finder:

In Finder, choose Go > Go To Folder. In the Go To The Folder field, enter ~/library/

Where is the OpenSSL Library? ›

20.8. 2 Location of OPENSSL
Operating SystemLibraries
Linux/usr/lib/libssl.so
Windowslibeay32.dll libssl32.dll
Solarislibcrypto.so libssl.so
Mac OS X/usr/lib/libssl.dylib
1 more row

Can you use OpenSSL on Mac? ›

To install the OpenSSL toolkit and library on your Mac, you must open the Terminal application, go to the OpenSSL source folder, and follow the instructions from the INSTALL file included in the archive.

Where do I put Java libraries on Mac? ›

To install a new Java library on a Mac OS X system, put the JAR file into /Library/Java/Extensions (if everyone on your system needs it) or ~/Library/Java/Extensions (if it will only be used by you).

Top Articles
Latest Posts
Article information

Author: Jamar Nader

Last Updated:

Views: 5908

Rating: 4.4 / 5 (55 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Jamar Nader

Birthday: 1995-02-28

Address: Apt. 536 6162 Reichel Greens, Port Zackaryside, CT 22682-9804

Phone: +9958384818317

Job: IT Representative

Hobby: Scrapbooking, Hiking, Hunting, Kite flying, Blacksmithing, Video gaming, Foraging

Introduction: My name is Jamar Nader, I am a fine, shiny, colorful, bright, nice, perfect, curious person who loves writing and wants to share my knowledge and understanding with you.