For building one particular library I need openssl library version 1.0.2m with devel package. I am working on macOS. Using brew install openssl
installs latest version 1.1.1d.
OpenSSL provides support for the TLS and SSL protocols and also includes various tools used in cryptography. Note that OpenSSL is officially available only as source, so you must manually compile and install the software on your Mac.
OpenSSL 3.0 is the latest major version of OpenSSL.
Since OpenSSL 1.0.2 is end of lifed by the end of 2019, it is no longer available via Homebrew. This is mentioned in the Homebrew 2.2.0 announcement.
It is fairly straightforward to build and install OpenSSL 1.0.2 yourself from source. You can download your required version from the Old 1.0.2 Releases page and follow the instructions found in INSTALL.
It may be possible as well to recover an older formula and install from that, but I can not guarantee how well that works. The following steps did complete the installation process:
$ git clone https://github.com/Homebrew/homebrew-core.git
$ cd homebrew-core
$ git checkout 75b57384 Formula/openssl.rb
$ brew install Formula/openssl.rb
For me, this showed:
Warning: openssl 1.1.1d is available and more recent than version 1.0.2m.
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2m.high_sierra.bottle.tar.gz
and went on happily after that. A quick try at the end gives some confidence that it worked out well:
$ /usr/local/opt/openssl/bin/openssl version
OpenSSL 1.0.2m 2 Nov 2017
If you prefer not to use git
directly, you can also try downloading that version of openssl.rb
from gitHub.com
and run brew install
on it.
If you wonder where that commit hash came from, I happened to know that the formula used to be called -- surprise -- openssl.rb
(but using git
to query for removed files would have worked as well). Therefore, I inspected the history for Formula/openssl.rb
and found:
$ git log -- Formula/openssl.rb
...
commit 75b573845a17aaf3f7c84dc58e97cf5fe39a502b
Author: BrewTestBot <[email protected]>
Date: Thu Nov 2 17:20:33 2017 +0000
openssl: update 1.0.2m bottle.
Recently I was struggling due to the recent update in openssl version from 1.0 to 1.1 and wanted to revert it back to older version. No other solution except the one given below worked for me:
brew install rbenv/tap/[email protected]
rvm reinstall 1.9.3-p551 --with-openssl-dir='/usr/local/opt/[email protected]'
gem update --system
Instead of downloading the specific version of Formula/openssl.rb
you can just use the raw reference to the file with the specific commit SHA as mentioned here.
So for the last update to version 1.0.2t the SHA is 8b9d6d688f483a0f33fcfc93d433de501b9c3513
commit 8b9d6d688f483a0f33fcfc93d433de501b9c3513
Author: BrewTestBot <[email protected]>
Date: Sat Sep 28 19:38:49 2019 +0000
openssl: update 1.0.2t bottle.
So I would execute the following command to install 1.0.2t.
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/8b9d6d688f483a0f33fcfc93d433de501b9c3513/Formula/openssl.rb
1- Download the file:
wget https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
2 - Run brew with the file downloaded:
brew install openssl.rb
Other solutions won't work because you will get this error "Calling Installation of openssl from a GitHub commit URL is disabled! Use 'brew extract openssl' to stable tap on GitHub instead."
the following steps will fix it:
cd /usr/local/Homebrew/
git checkout 2.3.0
HOMEBREW_NO_AUTO_UPDATE=1 brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
git co -
openssl
this way you can chose wich version to use if you have both intalledbrew switch openssl 1.0.2t
Update - I think I've been getting downvotes because I've simply posted a link without the solution. So here's the solution:
brew install [email protected]
echo 'export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"' >> ~/.zshrc
export LDFLAGS="-L/opt/homebrew/opt/[email protected]/lib"
export CPPFLAGS="-I/opt/homebrew/opt/[email protected]/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/[email protected]/lib/pkgconfig"
source ~/.zshrc
> openssl version
OpenSSL 1.0.2u 20 Dec 2019
rvm autolibs disable
export RUBY_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC
export optflags="-Wno-error=implicit-function-declaration"
rvm install 2.3.0 --with-openssl-dir=/opt/homebrew/opt/[email protected]
Ref
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With