Skip to content

Instantly share code, notes, and snippets.

@zulhfreelancer
Last active February 26, 2024 19:46
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save zulhfreelancer/4a609f65dfc396e395e5d5713fb3dd0f to your computer and use it in GitHub Desktop.
Save zulhfreelancer/4a609f65dfc396e395e5d5713fb3dd0f to your computer and use it in GitHub Desktop.
How to switch OpenSSL version on Mac using Homebrew?

How to switch OpenSSL version on Mac using Homebrew?

Scenario: you have both OpenSSL 1.0 and 1.1 installed (using Brew) in your OSX system and you want to switch the current active version without removing other versions that already installed. Here is how to do it.

Step 1 - List all OpenSSL versions

$ ls -al /usr/local/Cellar/openssl*

/usr/local/Cellar/openssl:
total 0
drwxr-xr-x  13 zulhilmi  staff  442 Apr 21 04:31 1.0.2t

/usr/local/Cellar/openssl@1.1:
total 0
drwxr-xr-x  13 zulhilmi  staff  442 Apr 21 04:01 1.1.1f
drwxr-xr-x  13 zulhilmi  staff  442 Apr 24 15:41 1.1.1g

Step 2a - Switching to version 1.0

$ brew switch openssl 1.0.2t

Step 2b - Switching to version 1.1

$ brew switch openssl@1.1 1.1.1f

Step 3 - Check new version

$ openssl version
OpenSSL 1.1.1f  31 Mar 2020

Reference:

@Overload119
Copy link

Error: Unknown command: switch

@zulhfreelancer
Copy link
Author

Error: Unknown command: switch

This might help Homebrew/discussions#339

@DavaGordon
Copy link

Switch is deprecated use brew link openssl@1.1 instead

@LizzyOrji123
Copy link

This worked for me.
I unlinked the current version using $brew unlink openssl@1.0
Then i linked the version i need to use using $brew link openssl@1.1
Finally i checked the openssl version and i got OpenSSL 1.1.1w 11 Sep 2023

It worked.

@vivipoit
Copy link

Thank you for this! And thank you @LizzyOrji123, as well!

@LizzyOrji123
Copy link

Thank you for this! And thank you @LizzyOrji123, as well!

You are welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment