44

Using electron-builder to build Windows app, When signing up, I got this error :

dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
  Referenced from: /Users/puss/Library/Caches/electron-builder/winCodeSign/winCodeSign-1.7.0/darwin/osslsigncode
  Reason: image not found
yiye
  • 863
  • 1
  • 7
  • 8
  • https://stackoverflow.com/questions/59006602/dyld-library-not-loaded-usr-local-opt-openssl-lib-libssl-1-0-0-dylib/59184347#59184347 – Taher Jan 24 '20 at 02:03
  • The exact same error happens when you try to run `watchman watch-del-all` as suggested by the iOS simulator running React Native. – Raphael Pinel Mar 10 '20 at 07:37

13 Answers13

49

If you are in MacOS 10.15 (Catalina), try this (reinstall openssl):

brew update && brew upgrade
brew uninstall openssl
brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
unifreak
  • 773
  • 6
  • 17
  • Nice one, seems like the the new brew formula is broken, can't link it, etc. This works. – Computer's Guy Dec 08 '19 at 03:26
  • Still on MacOS 10.11.6 (El Capitan) myself, this was a big help for me, too: finally got mysql2 to build on a ruby 1.9.3 env.. – Benny Degezelle Dec 30 '19 at 20:20
  • 6
    If having `openssl` already installed. Please uninstall it using `brew uninstall --ignore-dependencies openssl`. And then do `brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb` – jayiitb Jan 03 '20 at 04:35
  • 3
    when I did ```brew update && brew upgrade``` The issue resolved. – Anas Red Jan 08 '20 at 13:14
  • Worked like a charm on Mojave as well – tomahaug Jan 20 '20 at 10:50
  • Worked on Catalina as well. – mario199 Feb 06 '20 at 10:00
  • If it is already installed, you can run `brew reinstall openssl@1.1` – Raphael Pinel Mar 10 '20 at 07:32
  • little late to Party, But I can confirm this works perfectly on Mojave as I had to downgrade to Mojave from Catalina because of hibernate not working on Catalina anymore. – Asad ullah Mar 30 '20 at 20:53
  • High Sierra and `brew update && brew upgrade` was everything I need to have it working again. TY – Carlos Faria Apr 07 '20 at 18:51
  • In Xcode 11.4 on macOS 10.5.4 (Catalina), this worked for building but when running my app, Xcode would complain that libcrypto.1.0.0.dylib "has no cdhash, completely unsigned". My updated project had Hardened Runtime enabled so I had to also enable "Disable Library Validation" in "Runtime Exceptions" in the "Signing & Capabilities" tab for my target. – Jon Apr 15 '20 at 13:33
  • ```brew update && brew upgrade``` solved the issue on Catalina as well. Thank you! – youngpanda Jan 25 '21 at 10:28
  • 1
    I received an error when trying to do `brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb`: `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)`. Downloading the file and doing `brew install -s openssl.rb` did the trick. – johna Mar 24 '21 at 21:27
  • A simple brew update && brew upgrade worked for me. – pensebien May 13 '21 at 12:22
38

I try to uninstall openssl and reinstall openssl, It worked.

brew remove openssl
brew install openssl
yiye
  • 863
  • 1
  • 7
  • 8
  • 14
    I needed this after a Mac OSx Migrate – CenterOrbit Jan 19 '18 at 21:45
  • 7
    Works for me after migrating my MacBook. – rj487 Feb 16 '18 at 15:13
  • 2
    If I try to remove openssl I get `Refusing to uninstall /usr/local/Cellar/openssl@1.1/1.1.1g because it is required by apr-util, elixir, erlang, freetds, httpd, libevent, libpq, libxml2, macvim, mysql, nghttp2, php71-mcrypt, postgresql, python, python@2, python@3.8, ruby, ruby-build, thefuck and wget, which are currently installed.`. If I uninstall, Might these libs stop working properly? – Andre Ravazzi Jun 21 '20 at 03:07
  • 1
    @AndreRavazzi I tried to uninstall anyway and reinstall, and it works fine – chengsam Sep 22 '20 at 06:08
  • 1
    @AndreRavazzi yes, they might, but you're going to be re-installing openssl – saylestyler Feb 18 '23 at 03:18
31

Just switch to 1.0.2t version, using this command:

brew switch openssl 1.0.2t
Bruno Wego
  • 2,099
  • 3
  • 21
  • 38
15

For me, re-installing openssh (not openssl) was the only solution.

brew remove openssh
brew install openssh
snwfdhmp
  • 360
  • 2
  • 11
3

Thanks unifreak, I fixed this problem on macOS v10.11.6 at Tue Apr 28 2020 again.

REF: https://stackoverflow.com/a/59224109/686105

  1. Update homebrew index and upgrade. (option)

    [ chusiang@osx_el_capitan ~ ]
    $ brew update && brew upgrade
    
  2. Try to remove the openssl@1.1.

    [ chusiang@osx_el_capitan ~ ]
    $ brew uninstall openssl@1.1
    Error: Refusing to uninstall /usr/local/Cellar/openssl@1.1/1.1.1g
    because it is required by ansible-lint, atk, cairo, gdk-pixbuf, glib, gnupg, gnutls, gobject-introspection, gsettings-desktop-schemas, gtk+3, gtk-doc, harfbuzz, ipmitool, ipython, irssi, itstool, krb5, libevent, libfido2, libpq, libssh, libssh2, libxml2, macvim, meson, nmap, openssh, pango, pgcli, postgresql, python, python@2, python@3.8, ruby, rust, s3cmd, sdcv, sphinx-doc, sshuttle, tcpdump, tmate, tmux, travis, unbound, vim, w3m, wget and zenity, which are currently installed.
    You can override this and force removal with:
      brew uninstall --ignore-dependencies openssl@1.1
    
  3. Remove the openssl@1.1 with --ignore-dependencies args.

    [ chusiang@osx_el_capitan ~ ]
    $ brew uninstall --ignore-dependencies openssl@1.1
    Uninstalling /usr/local/Cellar/openssl@1.1/1.1.1g... (8,052 files, 18.4MB)
    
  4. Install the specific version of openssl v1.0.0.

    [ chusiang@osx_el_capitan ~ ]
    $ brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
    
  5. Lock the openssl version with v1.0.0.

    [ chusiang@osx_el_capitan ~ ]
    $ brew pin https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
    
  6. Add this openssl into $PATH.

    [ chusiang@osx_el_capitan ~ ]
    $ echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
    
  7. Apply this change of $PATH.

    [ chusiang@osx_el_capitan ~ ]
    $ source ~/.bash_profile
    
  8. DONE.

    [ chusiang@osx_el_capitan ~ ]
    $ openssl version
    OpenSSL 1.0.2t  10 Sep 2019
    

Finally, the ssh / git / ansible were back !

Chu-Siang Lai
  • 2,658
  • 1
  • 24
  • 21
3

Here's what worked for me

brew update && brew upgrade
brew uninstall --ignore-dependencies openssl 
brew install openssl
stevec
  • 41,291
  • 27
  • 223
  • 311
2

I had the same problem. In my case, for a legacy Rails 2.4 app. It seems brew had updated /usr/local/opt/openssl to symlink to openssl@1.1/1.1.1d.

After trying several other things, I fixed it by manually updating the symlink /usr/local/opt/openssl to point to the 1.0.2s version that was already on my system:

MacBook-Pro/usr/local/opt(:|✔) % pwd
/usr/local/opt
MacBook-Pro/usr/local/opt(:|✔) % ll openssl*
lrwxr-xr-x  1 dhempy  admin  24 Feb 19 11:36 openssl -> ../Cellar/openssl/1.0.2s
lrwxr-xr-x  1 dhempy  admin  28 Feb 19 08:55 openssl@1.1 -> ../Cellar/openssl@1.1/1.1.1d

Hopefully this is one-and-done for me, and I won't have to reapply that symlink after every update.

David Hempy
  • 5,373
  • 2
  • 40
  • 68
  • Three years later, this has proven to be a one-and-done for me, and I don't have to reapply that symlink after every update. – David Hempy Feb 21 '23 at 20:37
2

brew doctor gave me the following warning:

Warning: Some installed formulae are missing dependencies.
You should `brew install` the missing dependencies:
  brew install openssl@1.1

this command fixed my issue

brew install openssl@1.1
Mesut GUNES
  • 7,089
  • 2
  • 32
  • 49
0

Reinstalling watchman with brew solved the issue for me :

brew remove watchman

brew install watchman

I hope it helps,

mahmoud mehdi
  • 1,493
  • 1
  • 19
  • 28
0

This is the process I had to use to fix this issue. I am not sure how to use brew extract correctly.

We need openssl in order to use wget.

brew install openssl

Now, download version 1.0.2t and install it.

wget https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
brew install openssl.rb
Dantheman91
  • 774
  • 9
  • 15
0

If you are using a conda env, simply use

conda install -c bioconda samtools openssl=1.0
Shrm
  • 426
  • 4
  • 8
0

I had to run these commands because my problematic package appeared to be ldns:

brew uninstall --ignore-dependencies ldns
brew install ldns
0

I tried each and every one of these answers and still was getting the error from question.

Solution was to:

  1. brew uninstall --ignore-dependencies openssl@<any&all brew ssl versions>
  2. remove the files manually from /usr/local/etc (the locations of these are listed after step 1)
  3. remedy the $PATH error: aka tell ssh command where it should be looking, by adding export PATH=/bin:/usr/bin:/usr/local/bin to ~/.zshrc or ~/.profile or ~/.bashrc depending on what shell you use.

hope this helps someone.

saylestyler
  • 389
  • 1
  • 4
  • 20