Skip to content

Instantly share code, notes, and snippets.

@darrenboyd
Last active January 11, 2024 09:02
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save darrenboyd/58647ca3c31bd0ed4105 to your computer and use it in GitHub Desktop.
Save darrenboyd/58647ca3c31bd0ed4105 to your computer and use it in GitHub Desktop.
A quick guide to downgrading OpenSSL with Homebrew

OBSOLETE

THIS INFORMATION IS NOW OUT OF DATE, AND EXISTS HERE ONLY FOR ARCHIVAL PURPOSES

TROUBLESHOOTING

Excon Error

You may suffer an error that looks like this. It's possible you are setting up a new Mac, or you just recompiled your Ruby.

Excon::Errors::SocketError in ...
Bad address (Errno::EFAULT)

At fault is OpenSSL (or, an integration with it). You'll likely need to get a different version of it. Assuming you are using Homebrew, do the following...

$ brew tap homebrew/versions
$ brew versions openssl

You should see a number of versions listed, look for 1.0.1l...

...
1.0.1l   git checkout b5cffc8 /usr/local/Library/Formula/openssl.rb
...
# Get this version in your Library by doing...
$ cd /usr/local/Library/Formula/
$ git checkout b5cffc8 /usr/local/Library/Formula/openssl.rb

NOTE: Make sure you use your path and git-ref, not what is shown in this example.

Then rebuild ruby.

  $ rvm reinstall 2.1.0 # CHANGE TO YOUR RUBY VERSION

And that should fix it.

@zubin
Copy link

zubin commented Mar 3, 2015

Looks like brew versions was removed:

Unknown command: versions

This is an alternative way:

brew update
brew uninstall openssl
brew install openssl101

(then reinstall ruby)

@mahcloud
Copy link

zubin, to gain access to brew versions command, you can run:

brew tap homebrew/boneyard

@mahcloud
Copy link

darrenboyd, I'm getting a no remote repository specified error.
Where should I be pointing /usr/local/Library/Formula/ at?

@brandonros
Copy link

This whole guide doesn't work in 2020.

@darrenboyd
Copy link
Author

Odd how often things from the (technologically) distant past surface every once in awhile. I'll put a note at the very top of the post that this no longer works, if anyone has links to a better solution, please comment here, and I will add references to them. Since I no longer use brew (no longer on a Mac), I don't know what a good solution to this problem is.

@gulymaestro
Copy link

Here is what worked for me:

brew install rbenv/tap/openssl@1.0
rvm reinstall 1.9.3-p551 --with-openssl-dir='/usr/local/opt/openssl@1.0'
gem update --system

Cheers!

@alexmalik
Copy link

@gulymaestro yes! was on this problem for a few hours and this was the fix, thankyou!

@akhil-trantor
Copy link

Here is what worked for me:

brew install rbenv/tap/openssl@1.0
rvm reinstall 1.9.3-p551 --with-openssl-dir='/usr/local/opt/openssl@1.0'
gem update --system

Cheers!

@gulymaestro I tried every other solution present online but did not work. This is the real fix. Thank you so much .

@HenryAquino
Copy link

thank you

@lmsilvera
Copy link

Here is what worked for me:

brew install rbenv/tap/openssl@1.0
rvm reinstall 1.9.3-p551 --with-openssl-dir='/usr/local/opt/openssl@1.0'
gem update --system

Cheers!

👍🏽

@Pelipas-EE
Copy link

Here is what worked for me:

brew install rbenv/tap/openssl@1.0
rvm reinstall 1.9.3-p551 --with-openssl-dir='/usr/local/opt/openssl@1.0'
gem update --system

Cheers!

Thx a lot! 👍

@gongpengjun
Copy link

I found the solution works for me on mac os x Catalina.

  1. Download the file: https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
  2. Run brew with the file downloaded: brew install openssl.rb

@mgrn0
Copy link

mgrn0 commented Dec 3, 2020

I found the solution works for me on mac os x Catalina.

  1. Download the file: https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
  2. Run brew with the file downloaded: brew install openssl.rb

thanks, this was the only suggestions from above that actually did work for me.

@tomijovanoski
Copy link

I found the solution works for me on mac os x Catalina.

  1. Download the file: https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
  2. Run brew with the file downloaded: brew install openssl.rb

Thank you! This was the only way working for me.

@3minus1
Copy link

3minus1 commented Aug 6, 2021

For people having trouble with downgrading openssl for installing old Ruby versions this guide might help
https://medium.com/@akforsn/installing-old-ruby-versions-on-apple-m1-step-by-step-guide-501bb893c843

@TidbitSoftware
Copy link

Here is what worked for me:

brew install rbenv/tap/openssl@1.0
rvm reinstall 1.9.3-p551 --with-openssl-dir='/usr/local/opt/openssl@1.0'
gem update --system

Cheers!

@gulymaestro Saved my skin!

@joshlin
Copy link

joshlin commented Feb 14, 2022

It didn't work for me. Showed me the error message below:
rbenv/homebrew-tap#4

Followed the #2 solution to successfully install it:
rbenv/homebrew-tap#2 (comment)

Cheers!

@kenurbanstems
Copy link

not working in mac m1 year 2022

brew install rbenv/tap/openssl@1.0
brew install rbenv/tap/openssl@1.0 not working anymore rbenv/homebrew-tap#1

@Victorcorcos
Copy link

@mahcloud , the solution you provided is not working anymore

$ brew tap homebrew/boneyard

==> Tapping homebrew/boneyard
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-boneyard'...
remote: Repository not found.
fatal: repository 'https://github.com/Homebrew/homebrew-boneyard/' not found
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-boneyard /usr/local/Homebrew/Library/Taps/homebrew/homebrew-boneyard --origin=origin --template= --config core.fsmonitor=false` exited with 128.

@mahcloud
Copy link

@mahcloud , the solution you provided is not working anymore

$ brew tap homebrew/boneyard

==> Tapping homebrew/boneyard
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-boneyard'...
remote: Repository not found.
fatal: repository 'https://github.com/Homebrew/homebrew-boneyard/' not found
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-boneyard /usr/local/Homebrew/Library/Taps/homebrew/homebrew-boneyard --origin=origin --template= --config core.fsmonitor=false` exited with 128.

sorry @Victorcorcos , it looks like this document has been labeled as obsolete

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