How to update Openssl on MacOS


Does your MacBook have an unsupported version of OpenSSL? In this small article, I’ll show you how you can install the supported version in simple steps in the terminal.
Verify the installed version
Uninstall the old version
Install the new version
Update the path
Reload the shell
Verify
To uninstall and install OpenSSL, you will need to use the terminal app. And you need administrator privileges in order to be successful. So open the terminal app and follow the steps below.
Verify the installed version
$ openssl version
Uninstall unsupported version
$ brew uninstall openssl@1.1
Optionally, you might have to run an extra command in order to remove remnants or uninstall the unwanted OpenSSL version completely.
$ rm -rf /opt/homebrew/etc/openssl@1.0
Install the current supported version
$ brew install openssl@3
Update your PATH to use the new version
$ echo 'export PATH="/usr/local/opt/openssl@3/bin:$PATH"' >> ~/.zshrc
# Or if using bash:
# $echo 'export PATH="/usr/local/opt/openssl@3/bin:$PATH"' >> ~/.bashrc
# Update compiler flags for building software that uses OpenSSL
$ export LDFLAGS="-L/usr/local/opt/openssl@3/lib"
$ export CPPFLAGS="-I/usr/local/opt/openssl@3/include"
$ export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig"
Reload your shell configuration
$ source ~/.zshrc
# or source ~/.bashrc if using bash
Verify the installation
$ openssl version
If all is well, you will see something like this.
Subscribe to my newsletter
Read articles from David Wampamba directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

David Wampamba
David Wampamba
My journey as a self-taught developer began with a burning curiosity. Growing up in Uganda, where resources were scarce, I couldn't afford a formal education. Instead, I relied on handwritten notes from friends and online tutorials. As time went on, I got good at building websites for local businesses, each project proving my self-taught skills. But my dream of joining a major tech company seemed unreachable. Rejections piled up, all due to my academic background and self-doubt crept in. Then, a turning point. A friend I had shared my knowledge with landed a job at a promising startup in Kampala. He believed in me and recommended me. For five years now, I've been working remotely for that very company. They saw the potential in passionate, self-taught talent. But my heart is saddened by the millions in Uganda and the world facing the same challenges. That's why I am sharing my knowledge on this platform and other social platforms. My expertise is in PHP, JavaScript, WordPress, Technical Writing and business leadership. If you want to learn from me or collaborate, consider to follow or send me a on X.com/davidofug