aisingapore / TagUI

Free RPA tool by AI Singapore
Apache License 2.0
5.61k stars 582 forks source link

macOS OpenSSL version issue - Homebrew moved it from v1.0 to v1.1 - initial fix #635

Closed muratcim closed 4 years ago

muratcim commented 4 years ago

Hi Guys, for TagUI we may have found the permanent solution. Note that this solution may not help for other projects. Download directly from below link. After unzipping, put contents of unzipped folder into tagui/src/phantomjs folder.

https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-macosx.zip

Though above zip is PhantomJS v2.1.1 (same as TagUI packaged PJS), total file size for this zip after extraction is different. It might be Ariya, creator of PhantomJS, put in a fix already just to solve this headache with macOS/OpenSSL/Homebrew.


Hi Ken,

Today I encountered some error related to openssl while installing tagui on my mac computer. 2.2.0 version of homebrew released on November 27. In this version openssl 1.0 has been deleted for end of life.brew install openssl now installs version 1.1

referance: https://brew.sh/2019/11/27/homebrew-2.2.0/

Version 1.1 has /usr/local/opt/openssl/lib/libssl.1.1.dylib instead of /usr/local/opt/openssl/lib/libssl.1.0.0.dylib

So the following lines of code in the tagui python project don't work

if not os.path.isfile('/usr/local/opt/openssl/lib/libssl.1.0.0.dylib'): This can be corrected in some way, but most importantly, phantom addiction.phantom gives the following error in openssl 1.1 version

dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib Referenced from: /Users/mcim/.moxie-tagui/phantomjs/bin/phantomjs Reason: image not found

I continue to research about the problem and I will share it when there is an improvement

kensoh commented 4 years ago

Thanks for raising this Murat! I appreciate your detailed replication details. Let me have a look.

kensoh commented 4 years ago

It seems that the recommended way to install older versions of a Homebrew formula (https://github.com/Homebrew/homebrew-core/pull/46876) is not working.

When the recommended way using brew extract is used as follows -

brew uninstall openssl
brew tap-new $USER/old-openssl
brew extract --version=1.0.2t openssl $USER/old-openssl
brew install openssl@1.0.2t

I get the errors below, which seems to be issue with Homebrew's incorrect mapping to the download URL, though the correct download URLs are extracted to the file -

/usr/local/Homebrew/Library/Taps/$USER/homebrew-old-openssl/Formula/openssl@1.0.2t.rb
==> Installing openssl@1.0.2t from $USER/old-openssl
==> Downloading https://homebrew.bintray.com/bottles-old-openssl/openssl@1.0.2t-1.0.2t.catalina.bottle.tar.gz
#=#=-#  #                                                                     
curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "openssl@1.0.2t"
Download failed: https://homebrew.bintray.com/bottles-old-openssl/openssl@1.0.2t-1.0.2t.catalina.bottle.tar.gz
kensoh commented 4 years ago

However, by tracing the Homebrew commit history, trying to brew install below_url -

https://raw.githubusercontent.com/Homebrew/homebrew-core/827dd8b591367bce6c8d128cd3c164f6319be2cd/Formula/openssl.rb

.. will lead to SHA checksum not matching error.

kensoh commented 4 years ago

A solution that I found to be working, is manually update the checksum from the file generated by the brew extract method into the file in the GitHub URL above. Thus the file must be hosted somewhere else. A working solution seems to be below command. There are 2 uninstall commands to make sure any OpenSSL v1.1 is removed, and any dead v1.0 is removed, before installing v1.0.

brew uninstall openssl; brew uninstall openssl; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb

In the meantime, have raised an issue to Homebrew on why the recommended and supported method is not working and above hack has to be used - https://github.com/Homebrew/homebrew-core/issues/47368


A Homebrew maintainer replied that the error on download failed is expected and the expectation is user install Xcode command line utilities in order to build from source. I'm evaluating and not likely to go via that way, because it adds additional dependencies and friction for users.

Until a better solution is found, my preference is using above self-hosted solution instead of building from source by users or building from source and maintaining the binaries ourselves.

kensoh commented 4 years ago

The solution seems to be running below commands in terminal. There are 2 uninstall commands to make sure any OpenSSL v1.1 is removed, and any dead v1.0 is removed, before installing v1.0.

The v1.0 Homebrew formula below is created by combining the SHA checksums of the brew extract method with the git commit history of OpenSSL v1.0 formula (specifically v1.0.2t).

brew uninstall openssl; brew uninstall openssl; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
muratcim commented 4 years ago

Hello, Ken, Thank you for your clever solution.I tried it works

jrreyes29 commented 4 years ago

The solution seems to be running below commands in terminal. There are 2 uninstall commands to make sure any OpenSSL v1.1 is removed, and any dead v1.0 is removed, before installing v1.0.

The v1.0 Homebrew formula below is created by combining the SHA checksums of the brew extract method with the git commit history of OpenSSL v1.0 formula (specifically v1.0.2t).

brew uninstall openssl; brew uninstall openssl; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb

I can't still install ruby , when I run rvm install 2.5.1 , rvm start to install openssl@1.1 I tried setting up the --with-openssl-lib=/opt/local/lib/openssl-1.0 --with-openssl-include=/opt/local/include/openssl-1.0 , and still nothing, do you know why rvm start to install the new openssl?

kensoh commented 4 years ago

Hi @jrreyes29 this issue has nothing to do with rvm Ruby version manager. Above solution is only meant to solve the problem faced with using TagUI. Try raising issue at RVM GitHub or mailing list support for advice how to fix for rvm.

kensoh commented 4 years ago

The solution above has been suggested for over a week without issues. Now giving feedback to Homebrew maintainer to do a final check on whether the solution is robust is sound - https://github.com/Homebrew/homebrew-core/issues/47368#issuecomment-564514496

Hi @muratcim so far have you run into problems using the solution? If yes let me know, then I'll improve on the solution above. Otherwise the entry point to use on macOS would be blocked.

muratcim commented 4 years ago

Hi Ken, Yesterday I tried again on my mojave computer.I have not encountered any problems. Open SSL version 1.0 was installed with homebrew

kensoh commented 4 years ago

Thanks Murat for verifying and your feedback!

kensoh commented 4 years ago

Closing issue while waiting for new inputs from users and feedback from Homebrew maintainer.

At the other project TagUI for Python, I'm running a free Starbucks promotion for users who raise unknown bugs. I replied there to you, pleasure to treat you and friend a drink!

https://github.com/tebelorg/TagUI-Python/issues/86

vitechliu commented 4 years ago

The solution seems to be running below commands in terminal. There are 2 uninstall commands to make sure any OpenSSL v1.1 is removed, and any dead v1.0 is removed, before installing v1.0.

The v1.0 Homebrew formula below is created by combining the SHA checksums of the brew extract method with the git commit history of OpenSSL v1.0 formula (specifically v1.0.2t).

brew uninstall openssl; brew uninstall openssl; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb

Thanks for this solution. Actually I know nothing about tagui but this really helps a lot of ruby/rails developers. Since homebrew removed openssl1.0 versions and easily gets it upgraded, many old rails project got crashed suddenly and we can't even find a formula to install the old versions... I searched everywhere and somehow only this issue helped..

kensoh commented 4 years ago

Thanks @liuzirui1122 for dropping by and leaving a thank you note, appreciate it!

Yes it turns out that the 2 changes (macOS removing OpenSSL switching to LibreSSL, and Homebrew upgrading to OpenSSL v1.1 removing v1.0) are impacting many people and apps. You see this issue https://github.com/kelaberetiv/TagUI/issues/86 here which tracks the solution. Every week there are over 3k unique visitors to that issue. Am glad that solving TagUI's problem, the solution indirectly is also helpful to others!

OllisGit commented 4 years ago

Thx @kensoh , but I need to added --ignore-dependencies and now everything is working fine, yeah!

phil-blain commented 4 years ago

Hi @kensoh,

It seems that the recommended way to install older versions of a Homebrew formula (Homebrew/homebrew-core#46876) is not working.

When the recommended way using brew extract is used as follows -

brew uninstall openssl
brew tap-new $USER/old-openssl
brew extract --version=1.0.2t openssl $USER/old-openssl
brew install openssl@1.0.2t

I get the errors below, which seems to be issue with Homebrew's incorrect mapping to the download URL, though the correct download URLs are extracted to the file -

/usr/local/Homebrew/Library/Taps/$USER/homebrew-old-openssl/Formula/openssl@1.0.2t.rb
==> Installing openssl@1.0.2t from $USER/old-openssl
==> Downloading https://homebrew.bintray.com/bottles-old-openssl/openssl@1.0.2t-1.0.2t.catalina.bottle.tar.gz
#=#=-#  #                                                                     
curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "openssl@1.0.2t"
Download failed: https://homebrew.bintray.com/bottles-old-openssl/openssl@1.0.2t-1.0.2t.catalina.bottle.tar.gz

just to let you know that this is a known brew extract issue : https://github.com/Homebrew/brew/issues/6059

The workaround in that thread (fixing the extracted formula) should let you use the original bottle from Homebrew's bintray, which might be more robust then depending on a specific URL from another GitHub projet (https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb)


EDIT: also see this comment by one of Homebrew's maintainer saying brew installing straight from an URL "is insecure and will break."

kensoh commented 4 years ago

Hi @phil-blain Philippe thanks for sharing these inputs!

Yes that's what I did, to use the brew extract method and modify the formula. However, the modified formula needs to be hosted somewhere. I can't expect normal TagUI users to be doing all the technical work of hacking brew and modifying formula just to use TagUI. I'll have to fix it and host the fix so that users can use the solution with a 1-liner.

The hosted URL https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb is the modified formula I'm hosting now after doing brew extract. I parked that in my dummy repo and dummy release for easy accessibility, similar to TagUI packaged installations. (in v6, we moved the packaged zips to park directly under the specific release in TagUI repo)

Antoine007 commented 4 years ago

If you need two parallel openssl (I needed 1.0.2 for some old mySQL) then keep your regular 1.1 version but alod run brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/8b9d6d688f483a0f33fcfc93d433de501b9c3513/Formula/openssl.rb to install the last 1.0 version to check both versions live in parallel: ls -al /usr/local/Cellar/openssl*

qcode1 commented 4 years ago

Currently having this issue with my openssl versions. Downgrading to 1.0.2t makes my mongo work but then corrupts my python version with this

dyld: Library not loaded: @executable_path/../.Python Referenced from: /Users/macbookair/../../../venv/bin/python Reason: image not found Abort trap: 6

What is a workaround because one works then the other doesn't

akhil-trantor commented 4 years ago

Recently I was struggling with my ruby installations due to the recent auto 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/openssl@1.0 rvm reinstall 1.9.3-p551 --with-openssl-dir='/usr/local/opt/openssl@1.0' gem update --system Now my ruby runs with openssl 1.0 where as all other libraries are working fine with openssl 1.1. You can look for something similar in the tech you are stuck with.

igormelao commented 4 years ago

A solution that I found to be working, is manually update the checksum from the file generated by the brew extract method into the file in the GitHub URL above. Thus the file must be hosted somewhere else. A working solution seems to be below command. There are 2 uninstall commands to make sure any OpenSSL v1.1 is removed, and any dead v1.0 is removed, before installing v1.0.

brew uninstall openssl; brew uninstall openssl; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb

In the meantime, have raised an issue to Homebrew on why the recommended and supported method is not working and above hack has to be used - Homebrew/homebrew-core#47368

A Homebrew maintainer replied that the error on download failed is expected and the expectation is user install Xcode command line utilities in order to build from source. I'm evaluating and not likely to go via that way, because it adds additional dependencies and friction for users.

Until a better solution is found, my preference is using above self-hosted solution instead of building from source by users or building from source and maintaining the binaries ourselves.

This worked for me! Thanks

Larzans commented 4 years ago

In case brew complains that 'Error: Refusing to uninstall /usr/local/Cellar/openssl@1.1/1.1.1g because it is required ...' just use the --force flag and then the command @kensoh mentioned here: https://github.com/kelaberetiv/TagUI/issues/635#issuecomment-560185670

So the command would be: brew uninstall openssl --force; brew uninstall openssl --force; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb

j3rrey commented 4 years ago

for me the above didn't rly help but this one did the trick:

brew uninstall openssl --ignore-dependencies; brew uninstall openssl --ignore-dependencies; brew uninstall libressl --ignore-dependencies; brew install openssh; https://apple.stackexchange.com/questions/386821/git-hangs-with-a-ssh-remote-uri-after-10-15-4-update/393338#393338

ManuelUrrutia commented 4 years ago

Hi. This post is a bit long because I included the full terminal output. Please feel free to edit if necessary. But I felt it was worth it to inform you of all the details because you solved my problem. Someone else may have the same error messages and could find their way to this post.

I recently performed an update/upgrade via

$> brew update; brew upgrade

on July 21, 2020. In the past, this has worked and required no further intervention. I installed what I was interested in and things worked. So no problems, right?

On July 28, 2020, youtube-dl was used and this is what it returned (pardon the verbosity):

################ $> youtube-dl ERROR:root:code for hash md5 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[func_name] = __get_hash(func_name) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type md5 ERROR:root:code for hash sha1 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[__func_name] = get_hash(func_name) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha1 ERROR:root:code for hash sha224 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[func_name] = __get_hash(func_name) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha224 ERROR:root:code for hash sha256 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[__func_name] = get_hash(func_name) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha256 ERROR:root:code for hash sha384 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[func_name] = __get_hash(func_name) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha384 ERROR:root:code for hash sha512 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[__func_name] = get_hash(func_name) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha512 Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/usr/local/bin/youtube-dl/main.py", line 16, in File "/usr/local/bin/youtube-dl/youtube_dl/init.py", line 15, in File "/usr/local/bin/youtube-dl/youtube_dl/options.py", line 8, in File "/usr/local/bin/youtube-dl/youtube_dl/downloader/init.py", line 3, in File "/usr/local/bin/youtube-dl/youtube_dl/downloader/common.py", line 10, in File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 30, in File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 98, in import _ssl # if we can't import it, let the error propagate ImportError: dlopen(/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ssl.so, 2): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib Referenced from: /usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ssl.so Reason: image not found $> ################

Given that it seems it can not work with python@2 files, I reasoned that it was possible that youtube-dl was compiled with that version of python, and further speculated that if I download the binary from its git repository, then I might not have the same problem. (Yes, I found articles about there being problems with python@2 but at this point I did not want to go down that rabbit hole.)

Unfortunately, using the curl method for download failed because it claimed that "SSL certificate problem: certificate has expired." So I forged ahead, used the wget method and installed it. I still got the same error message as above. That meant I had to look more carefully. The last error message states that libssl.1.0.0.dylib could not be found. Further search indicated that the entire /usr/local/opt/openssl folder did not exist and that is why the certificate had expired: it wasn't even there (shouldn't it have checked?). Going through the terminal output during the update/upgrade revealed that an older SSL version was removed but it is clear that it was not replaced. Looking for posts on libssl is what led me to this thread.

I applied the suggested solution and this is what terminal showed:

################ $> brew uninstall openssl; brew uninstall openssl; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb Error: Refusing to uninstall /usr/local/Cellar/openssl@1.1/1.1.1g because it is required by cairo, ffmpeg, gdal, geos, glib, gnuplot, gnutls, harfbuzz, imagemagick, krb5, libass, libdap, libevent, libheif, liblqr, libpq, libspatialite, libxml2, mdbtools, numpy, pango, poppler, python@2, python@3.8, rtmpdump, shared-mime-info, sphinx-doc, srt, unbound and wget, which are currently installed. You can override this and force removal with: brew uninstall --ignore-dependencies openssl Error: Refusing to uninstall /usr/local/Cellar/openssl@1.1/1.1.1g because it is required by cairo, ffmpeg, gdal, geos, glib, gnuplot, gnutls, harfbuzz, imagemagick, krb5, libass, libdap, libevent, libheif, liblqr, libpq, libspatialite, libxml2, mdbtools, numpy, pango, poppler, python@2, python@3.8, rtmpdump, shared-mime-info, sphinx-doc, srt, unbound and wget, which are currently installed. You can override this and force removal with: brew uninstall --ignore-dependencies openssl Updating Homebrew... ==> Auto-updated Homebrew! Updated Homebrew from 58317b47b to e637123cc. Updated 2 taps (homebrew/core and homebrew/cask). ==> New Formulae jimtcl jinx reg ==> Updated Casks ableton-live-lite fontexplorer-x-pro mumu shift webcatalog ableton-live-standard garagebuy nordvpn-teams sipgate-softphone webstorm ableton-live-suite google-chrome omnifocus surge wechatwork anydo juicebar onyx tap-forms wondershare-filmora boom-3d keep-it power-manager visual-paradigm codespace loginputmac proclaim visual-paradigm-ce deeper maintenance runway weakauras-companion

Warning: Calling Non-checksummed download of openssl formula file from an arbitrary URL is deprecated! Use 'brew extract' or 'brew create' and 'brew tap-new' to create a formula file in a tap on GitHub instead. ######################################################################## 100.0% ==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2t.mojave.bottle.tar.gz ==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/9874b2baf00f845355b163cb63b5c98a94a5cf7c08cda1d19876899b11b585c6?response ######################################################################## 100.0% Warning: openssl 1.1.1g is available and more recent than version 1.0.2t. ==> Pouring openssl-1.0.2t.mojave.bottle.tar.gz ==> Caveats A CA file has been bootstrapped using certificates from the SystemRoots keychain. To add additional certificates (e.g. the certificates added in the System keychain), place .pem files in /usr/local/etc/openssl/certs

and run /usr/local/opt/openssl/bin/c_rehash

openssl is keg-only, which means it was not symlinked into /usr/local, because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have openssl first in your PATH run: echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> /Users/raiz/.bash_profile

For compilers to find openssl you may need to set: export LDFLAGS="-L/usr/local/opt/openssl/lib" export CPPFLAGS="-I/usr/local/opt/openssl/include"

For pkg-config to find openssl you may need to set: export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"

==> Summary 🍺 /usr/local/Cellar/openssl/1.0.2t: 1,795 files, 12.0MB Removing: /Users/raiz/Library/Caches/Homebrew/openssl--1.0.2t.mojave.bottle.tar.gz... (3.7MB) $> ################

As you may note, the uninstall failed because many other packages depend on ssl being there. Yet, the scripts did not check for its libraries actually being there and I had not noticed because I had not run any of those other packages. The install process did go through and now youtube-dl works. I have no doubt that all the other packages also work and, indeed, your solution does work in many instances where this library is needed as you are ensuring that the correct version of ossl and its libraries are indeed installed.

Clearly, the update/upgrade scripts need to take care of this because it is still a problem on July 2020 after ossl was "fixed" in November 27, 2019.

Thank you for all your work and when this is over and if I am in your vicinity, I owe you a beer, if not a six-pack. :-)

bfeldman89 commented 4 years ago

Hi. This post is a bit long because I included the full terminal output. Please feel free to edit if necessary. But I felt it was worth it to inform you of all the details because you solved my problem. Someone else may have the same error messages and could find their way to this post.

I recently performed an update/upgrade via

$> brew update; brew upgrade

on July 21, 2020. In the past, this has worked and required no further intervention. I installed what I was interested in and things worked. So no problems, right?

On July 28, 2020, youtube-dl was used and this is what it returned (pardon the verbosity):

################ $> youtube-dl ERROR:root:code for hash md5 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[func_name] = __get_hash(func_name) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type md5 ERROR:root:code for hash sha1 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[__func_name] = get_hash(func_name) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha1 ERROR:root:code for hash sha224 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[func_name] = __get_hash(func_name) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha224 ERROR:root:code for hash sha256 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[__func_name] = get_hash(func_name) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha256 ERROR:root:code for hash sha384 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[func_name] = __get_hash(func_name) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha384 ERROR:root:code for hash sha512 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in globals()[__func_name] = get_hash(func_name) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type sha512 Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/usr/local/bin/youtube-dl/main.py", line 16, in File "/usr/local/bin/youtube-dl/youtube_dl/init.py", line 15, in File "/usr/local/bin/youtube-dl/youtube_dl/options.py", line 8, in File "/usr/local/bin/youtube-dl/youtube_dl/downloader/init.py", line 3, in File "/usr/local/bin/youtube-dl/youtube_dl/downloader/common.py", line 10, in File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 30, in File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 98, in import _ssl # if we can't import it, let the error propagate ImportError: dlopen(/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ssl.so, 2): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib Referenced from: /usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ssl.so Reason: image not found $> ################

Given that it seems it can not work with python@2 files, I reasoned that it was possible that youtube-dl was compiled with that version of python, and further speculated that if I download the binary from its git repository, then I might not have the same problem. (Yes, I found articles about there being problems with python@2 but at this point I did not want to go down that rabbit hole.)

Unfortunately, using the curl method for download failed because it claimed that "SSL certificate problem: certificate has expired." So I forged ahead, used the wget method and installed it. I still got the same error message as above. That meant I had to look more carefully. The last error message states that libssl.1.0.0.dylib could not be found. Further search indicated that the entire /usr/local/opt/openssl folder did not exist and that is why the certificate had expired: it wasn't even there (shouldn't it have checked?). Going through the terminal output during the update/upgrade revealed that an older SSL version was removed but it is clear that it was not replaced. Looking for posts on libssl is what led me to this thread.

I applied the suggested solution and this is what terminal showed:

################ $> brew uninstall openssl; brew uninstall openssl; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb Error: Refusing to uninstall /usr/local/Cellar/openssl@1.1/1.1.1g because it is required by cairo, ffmpeg, gdal, geos, glib, gnuplot, gnutls, harfbuzz, imagemagick, krb5, libass, libdap, libevent, libheif, liblqr, libpq, libspatialite, libxml2, mdbtools, numpy, pango, poppler, python@2, python@3.8, rtmpdump, shared-mime-info, sphinx-doc, srt, unbound and wget, which are currently installed. You can override this and force removal with: brew uninstall --ignore-dependencies openssl Error: Refusing to uninstall /usr/local/Cellar/openssl@1.1/1.1.1g because it is required by cairo, ffmpeg, gdal, geos, glib, gnuplot, gnutls, harfbuzz, imagemagick, krb5, libass, libdap, libevent, libheif, liblqr, libpq, libspatialite, libxml2, mdbtools, numpy, pango, poppler, python@2, python@3.8, rtmpdump, shared-mime-info, sphinx-doc, srt, unbound and wget, which are currently installed. You can override this and force removal with: brew uninstall --ignore-dependencies openssl Updating Homebrew... ==> Auto-updated Homebrew! Updated Homebrew from 58317b47b to e637123cc. Updated 2 taps (homebrew/core and homebrew/cask). ==> New Formulae jimtcl jinx reg ==> Updated Casks ableton-live-lite fontexplorer-x-pro mumu shift webcatalog ableton-live-standard garagebuy nordvpn-teams sipgate-softphone webstorm ableton-live-suite google-chrome omnifocus surge wechatwork anydo juicebar onyx tap-forms wondershare-filmora boom-3d keep-it power-manager visual-paradigm codespace loginputmac proclaim visual-paradigm-ce deeper maintenance runway weakauras-companion

Warning: Calling Non-checksummed download of openssl formula file from an arbitrary URL is deprecated! Use 'brew extract' or 'brew create' and 'brew tap-new' to create a formula file in a tap on GitHub instead. ######################################################################## 100.0% ==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2t.mojave.bottle.tar.gz ==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/9874b2baf00f845355b163cb63b5c98a94a5cf7c08cda1d19876899b11b585c6?response ######################################################################## 100.0% Warning: openssl 1.1.1g is available and more recent than version 1.0.2t. ==> Pouring openssl-1.0.2t.mojave.bottle.tar.gz ==> Caveats A CA file has been bootstrapped using certificates from the SystemRoots keychain. To add additional certificates (e.g. the certificates added in the System keychain), place .pem files in /usr/local/etc/openssl/certs

and run /usr/local/opt/openssl/bin/c_rehash

openssl is keg-only, which means it was not symlinked into /usr/local, because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have openssl first in your PATH run: echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> /Users/raiz/.bash_profile

For compilers to find openssl you may need to set: export LDFLAGS="-L/usr/local/opt/openssl/lib" export CPPFLAGS="-I/usr/local/opt/openssl/include"

For pkg-config to find openssl you may need to set: export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"

==> Summary 🍺 /usr/local/Cellar/openssl/1.0.2t: 1,795 files, 12.0MB Removing: /Users/raiz/Library/Caches/Homebrew/openssl--1.0.2t.mojave.bottle.tar.gz... (3.7MB) $> ################

As you may note, the uninstall failed because many other packages depend on ssl being there. Yet, the scripts did not check for its libraries actually being there and I had not noticed because I had not run any of those other packages. The install process did go through and now youtube-dl works. I have no doubt that all the other packages also work and, indeed, your solution does work in many instances where this library is needed as you are ensuring that the correct version of ossl and its libraries are indeed installed.

Clearly, the update/upgrade scripts need to take care of this because it is still a problem on July 2020 after ossl was "fixed" in November 27, 2019.

Thank you for all your work and when this is over and if I am in your vicinity, I owe you a beer, if not a six-pack. :-)

I had the same exact problem as @ManuelUrrutia! This was the only solution I could find that worked. Thank you so much, @kensoh!

seshadka commented 4 years ago

@kensoh, I too had similar issue with openssl and your suggestion worked like a gem! Thank you very much.

ScottNortonPhD commented 4 years ago

Seems the migration to 1.1 is incomplete, as rtracklayer now requires both versions of openssl which do not coexist nicely.

chengsam commented 4 years ago

The solution seems to be running below commands in terminal. There are 2 uninstall commands to make sure any OpenSSL v1.1 is removed, and any dead v1.0 is removed, before installing v1.0.

The v1.0 Homebrew formula below is created by combining the SHA checksums of the brew extract method with the git commit history of OpenSSL v1.0 formula (specifically v1.0.2t).

brew uninstall openssl; brew uninstall openssl; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb

An error occurred when I try this command

Error: Calling Non-checksummed download of openssl formula file from an arbitrary URL is disabled! Use 'brew extract' or 'brew create' and 'brew tap-new' to create a formula file in a tap on GitHub instead.
aryanagarwal15 commented 4 years ago

@chengsam I am also stuck with this same issue. Any guidance from the maintainers will be highly appreciated.

coleboothman commented 4 years ago

@chengsam @aryanagarwal15 following, I am also stuck on this issue as well

aryanagarwal15 commented 4 years ago

It seems Homebrew has disabled installation from Github commit URL.

I was able to download the version by this command:

brew tap-new company/team; brew extract --version 1.0.2t openssl company/team; brew install company/team/openssl@1.0.2t

Followed discussion here: https://discourse.brew.sh/t/has-brew-install-force-formula-raw-path-been-taken-out/8793

alsheuski commented 4 years ago

It worked for reinstall openssl, but it didn't helped with issue ERROR:root:code for hash md5 was not found. :(

David3434 commented 4 years ago

@Larzans Hello,Could you help me,I got following erros,thanks

jacks@Jackss-MBP ~ % brew uninstall openssl --force; brew uninstall openssl --force; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb Error: Calling Non-checksummed download of openssl formula file from an arbitrary URL is disabled! Use 'brew extract' or 'brew create' and 'brew tap-new' to create a formula file in a tap on GitHub instead. If reporting this issue please do so at (not Homebrew/brew or Homebrew/core): https://github.com/tebelorg/Tump/issues/new jacks@Jackss-MBP ~ %

aryanagarwal15 commented 4 years ago

@David3434 this seems to be an issue introduced in Homebrew 2.5.0

You can check which version of Homebrew is installed by running brew --version

You can use my previous response to implement how Homebrew now suggests it. Or if you want to use previous version of Homebrew to use these commands then follow this:

1) Go to Homebrew folder cd /usr/local/Homebrew/ 2) Checkout to the previous version by running git checkout 2.3.0 3) To install OpenSSL HOMEBREW_NO_AUTO_UPDATE=1 brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb

Hopefully this solves your issue.

David3434 commented 4 years ago

@aryanagarwal15 install successfully thank you very much for your help and have a good day !

`Last login: Sun Sep 27 12:01:40 on console jacks@Jackss-MBP ~ % cd /usr/local/Homebrew/ jacks@Jackss-MBP Homebrew % brew --version Homebrew 2.5.2-41-g9fbe13c Homebrew/homebrew-core (git revision 9834dc; last commit 2020-09-25) Homebrew/homebrew-cask (git revision 22076; last commit 2020-09-26) jacks@Jackss-MBP Homebrew % git checkout 2.3.0 Note: switching to '2.3.0'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example:

git switch -c

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 77e09fc16 Merge pull request #7661 from MikeMcQuaid/man-url-install jacks@Jackss-MBP Homebrew % HOMEBREW_NO_AUTO_UPDATE=1 brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb Warning: Calling Non-checksummed download of openssl formula file from an arbitrary URL is deprecated! Use 'brew extract' or 'brew create' and 'brew tap-new' to create a formula file in a tap on GitHub instead. ######################################################################## 100.0%-######################################################################## 100.0% ==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2t.catalina.bot ==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/c9c5e017edabe41ae55ed ######################################################################## 100.0% ==> Pouring openssl-1.0.2t.catalina.bottle.tar.gz ==> Caveats A CA file has been bootstrapped using certificates from the SystemRoots keychain. To add additional certificates (e.g. the certificates added in the System keychain), place .pem files in /usr/local/etc/openssl/certs

and run /usr/local/opt/openssl/bin/c_rehash

openssl is keg-only, which means it was not symlinked into /usr/local, because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have openssl first in your PATH run: echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl you may need to set: export LDFLAGS="-L/usr/local/opt/openssl/lib" export CPPFLAGS="-I/usr/local/opt/openssl/include"

For pkg-config to find openssl you may need to set: export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"

==> Summary 🍺 /usr/local/Cellar/openssl/1.0.2t: 1,795 files, 12MB jacks@Jackss-MBP Homebrew % `

juan267 commented 4 years ago

I just wanted to leave a detail summary (based on the comments above) on how to fix this issue at the current moment:

  1. First go to the local installation of homebrew

    cd /usr/local/Homebrew/
  2. Homebrew 2.5 remove the option to install formulas directly from git repos so we need to checkout an older version

    git checkout 2.3.0
  3. Install openssl latest 1.0.x version

    HOMEBREW_NO_AUTO_UPDATE=1 brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
  4. Go back to current version of homebrew

    git checkout -
  5. Tell brew to use the old version of openssl this way you can chose wich version to use if you have both intalled

    brew switch openssl 1.0.2t
olegueret commented 4 years ago

I just wanted to leave a detail summary (based on the comments above) on how to fix this issue at the current moment:

  1. First go to the local installation of homebrew
cd /usr/local/Homebrew/
  1. Homebrew 2.5 remove the option to install formulas directly from git repos so we need to checkout an older version
git checkout 2.3.0
  1. Install openssl latest 1.0.x version
HOMEBREW_NO_AUTO_UPDATE=1 brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
  1. Go back to current version of homebrew
git co -
  1. Tell brew to use the old version of openssl this way you can chose wich version to use if you have both intalled
brew switch openssl 1.0.2t

This worked for me except the git co - part: I had to use this instead to return Homebrew to the stable branch (as suggested by the note shown after checking to branch 2.3.0):

git switch -
David3434 commented 3 years ago

@aryanagarwal15 I can't install openssl 1.0 on mac big sur,Could you help me again thanks

`jacks@Jackss-MBP ~ % brew --version Homebrew 2.5.6 Homebrew/homebrew-core (git revision a7549a; last commit 2020-10-15) jacks@Jackss-MBP ~ % cd /usr/local/Homebrew/ jacks@Jackss-MBP Homebrew % git checkout 2.3.0 Note: switching to '2.3.0'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example:

git switch -c

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 77e09fc16 Merge pull request #7661 from MikeMcQuaid/man-url-install jacks@Jackss-MBP Homebrew % HOMEBREW_NO_AUTO_UPDATE=1 brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb

Traceback (most recent call last): 11: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in <main>' 10: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:inrequire_relative' 9: from /usr/local/Homebrew/Library/Homebrew/global.rb:37:in <top (required)>' 8: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:inrequire' 7: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require' 6: from /usr/local/Homebrew/Library/Homebrew/os.rb:3:in<top (required)>' 5: from /usr/local/Homebrew/Library/Homebrew/os.rb:21:in <module:OS>' 4: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:58:inprerelease?' 3: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:24:in version' 2: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:24:innew' 1: from /usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:26:in initialize' /usr/local/Homebrew/Library/Homebrew/version.rb:368:ininitialize': Version value must be a string; got a NilClass () (TypeError) jacks@Jackss-MBP Homebrew % `

aryanagarwal15 commented 3 years ago

@David3434 I would suggest once purging brew and doing a fresh install in Big Sur.

Apple introduced Command Line Tools 12 in Mac Big Sur which is not working well with Homebrew. A fresh install may solve the issue.

Please note: Purging Homebrew can cause serious damage to many applications which depend on brew packages, make sure you know what you are doing here.

phx135 commented 3 years ago

@aryanagarwal15 thanks for your reminder I decide to roll back to mac 10.15 have a nice day

David3434 commented 3 years ago

@aryanagarwal15 I found this https://juejin.im/post/6871032600492769293 and I do install it successfuly in mac big sur ,but I think it's wrong becuase here "perl ./Configure --prefix=/usr/local/Cellar/openssl/10.14.6" should be "perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.2t" I don't how to change it,Could you help me thanks

`jack@Jacks-MBP ~ % cd /usr/local/Homebrew/ jack@Jacks-MBP Homebrew % git checkout 2.3.0

Note: switching to '2.3.0'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example:

git switch -c

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 77e09fc16 Merge pull request #7661 from MikeMcQuaid/man-url-install jack@Jacks-MBP Homebrew % HOMEBREW_NO_AUTO_UPDATE=1 brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb Warning: Calling Non-checksummed download of openssl formula file from an arbitrary URL is deprecated! Use 'brew extract' or 'brew create' and 'brew tap-new' to create a formula file in a tap on GitHub instead. ######################################################################## 100.0%-######################################################################## 100.0% ==> Downloading https://www.openssl.org/source/openssl-1.0.2t.tar.gz Already downloaded: /Users/jack/Library/Caches/Homebrew/downloads/5d2da6a9ed1a20ef9d1b1418d79aa674cf5577b70ca1ce436fdaadfa04f0429c--openssl-1.0.2t.tar.gz ==> perl ./Configure --prefix=/usr/local/Cellar/openssl/10.14.6 --openssldir=/usr/local/etc/openssl no-ssl2 no-ssl3 no-zlib shared ena ==> make depend ==> make ==> make test ==> make install MANDIR=/usr/local/Cellar/openssl/10.14.6/share/man MANSUFFIX=ssl ==> Caveats A CA file has been bootstrapped using certificates from the SystemRoots keychain. To add additional certificates (e.g. the certificates added in the System keychain), place .pem files in /usr/local/etc/openssl/certs

and run /usr/local/opt/openssl/bin/c_rehash

openssl is keg-only, which means it was not symlinked into /usr/local, because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have openssl first in your PATH run: echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl you may need to set: export LDFLAGS="-L/usr/local/opt/openssl/lib" export CPPFLAGS="-I/usr/local/opt/openssl/include"

==> Summary 🍺 /usr/local/Cellar/openssl/10.14.6: 1,787 files, 12.5MB, built in 7 minutes 12 seconds jack@Jacks-MBP Homebrew %

`

alouanemed commented 3 years ago
```shell
HOMEBREW_NO_AUTO_UPDATE=1 brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb

Got the error below when run

HOMEBREW_NO_AUTO_UPDATE=1 brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb

The err:

/usr/local/Homebrew/Library/Homebrew/version.rb:368:ininitialize': Version value must be a string; got a NilClass () (TypeError) `

lenzirodrigo commented 3 years ago

I just wanted to leave a detail summary (based on the comments above) on how to fix this issue at the current moment:

  1. First go to the local installation of homebrew
cd /usr/local/Homebrew/
  1. Homebrew 2.5 remove the option to install formulas directly from git repos so we need to checkout an older version
git checkout 2.3.0
  1. Install openssl latest 1.0.x version
HOMEBREW_NO_AUTO_UPDATE=1 brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
  1. Go back to current version of homebrew
git checkout -
  1. Tell brew to use the old version of openssl this way you can chose wich version to use if you have both intalled
brew switch openssl 1.0.2t

brew switch is not working anymore:

Error: Calling `brew switch` is disabled! Use `brew link` @-versioned formulae instead.

See: https://github.com/Homebrew/discussions/discussions/339

sjmog commented 3 years ago
```shell
HOMEBREW_NO_AUTO_UPDATE=1 brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb

Got the error below when run

HOMEBREW_NO_AUTO_UPDATE=1 brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb

The err:

/usr/local/Homebrew/Library/Homebrew/version.rb:368:ininitialize': Version value must be a string; got a NilClass () (TypeError) `

@alouanemed I skipped this by just hard-coding val in /usr/local/Homebrew/Library/Homebrew/version.rb:368 (I set it to my OSX version, which is "11.0.1"). This allowed me to install the older openssl.

What I now cannot do is switch to using it since brew switch has been deprecated. Not sure how to link the older openssl.

christovski commented 3 years ago

The unfortunate reality is that Homebrew doesn't want to be a developer oriented package manager with version control, but a cowboy program installer & delivery method for the latest and greatest. See here: https://github.com/Homebrew/discussions/discussions/339#discussioncomment-249927

I guess the cost of maintaining brew switch was too high and it does not seem like you're ever going to get the same functionality you had before and should move away from expecting it from Homebrew.

As a work-around for this, it gets kinda lame if you just want it done. For me, it was two steps. You have to add the path to your old SSL version to your $(PATH) in your terminal profile

export PATH="/usr/local/opt/openssl/bin:$PATH"

and then update the symlink in /usr/local/opt to point to this directory

ln -fh /path/to/your/openssl/installation /usr/local/opt/openssl

kaldesigns commented 3 years ago

What I now cannot do is switch to using it since brew switch has been deprecated. Not sure how to link the older openssl.

If it helps, I was able to use brew switch by omitting the final git checkout - (step 4) in @juan267's comment.

Besides that, his answer works a charm!

yardz commented 3 years ago

@sjmog

@alouanemed I skipped this by just hard-coding val in /usr/local/Homebrew/Library/Homebrew/version.rb:368 (I set it to my OSX version, which is "11.0.1"). This allowed me to install the older openssl. What I now cannot do is switch to using it since brew switch has been deprecated. Not sure how to link the older openssl.

I had the same problem, but then I run brew link openssl@1.0.2t And I put this in .bash_profile:

export PATH="/usr/local/opt/openssl@1.0.2t/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl@1.0.2t/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.0.2t/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.0.2t/lib/pkgconfig"
krzysztofcyran93 commented 3 years ago

Hi, I'm having the same issue.

Now I'm on the step: user:~$ brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb Traceback (most recent call last): brew extract or brew create and brew tap-new to create a formula file in a tap on GitHub instead.: Invalid usage: Non-checksummed download of openssl formula file from an arbitrary URL is unsupported! (UsageError) brew extract or brew create and brew tap-new to create a formula file in a tap on GitHub instead.: Invalid usage: Non-checksummed download of openssl formula file from an arbitrary URL is unsupported! (UsageError)

Can someone please guide me here? Thanks

pushkargaikwad commented 3 years ago

Since I had to spend almost half a day to resolve this issue, here is my feedback and solution

  1. Big Sur with XCode is absolute mess. Apple need to be careful while making the dev tools live as it breaks lot of things.
  2. If you are on Big Sur, you will be on XCode 12 and you can not downgrade to 11.x version or command line tools.
  3. If you are on Big Sur, reinstalling brew will not help nor the above solutions. They will only work for XCode 11.x wit Command Line Tools 11.x

What worked for me was

CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.3.5

You can check the explanation here https://github.com/rbenv/ruby-build/issues/1489 or search in Google with the above to find why it works. If you have a few years old dev environment and software, avoid upgrading to big sur.

krzysztofcyran93 commented 3 years ago

I'm on Catalina...