Skip to content

Instantly share code, notes, and snippets.

@aklap
Created October 17, 2016 04:25
Show Gist options
  • Select an option

  • Save aklap/e885721ef15c8668ed0a1dd64d2ea1a7 to your computer and use it in GitHub Desktop.

Select an option

Save aklap/e885721ef15c8668ed0a1dd64d2ea1a7 to your computer and use it in GitHub Desktop.
Resolving missing link to libcrypto/openssl on OSX
@anantonton

Copy link
Copy Markdown

@vcjuliocesar Did you try downgrading your openSSL as I mentioned in the comment before:

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

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.

This is working for me!

@scalaview

scalaview commented Aug 22, 2020

Copy link
Copy Markdown

I got another problem when I uninstall 1.1 after install 1.0.

ruby-2.6.5/lib/ruby/2.6.0/x86_64-darwin17/digest/sha1.bundle, 9): Library not loaded: /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib

so I figure out to install both.

at first, cp the /usr/local/opt/openssl to /usr/local/Cellar/openssl/1.0.2t
then, uninstall 1.0 and reinstall 1.1.

brew uninstall openssl
brew install openssl@1.1

finally, link the old version to /usr/local/opt/openssl with below

ln -sf /usr/local/Cellar/openssl/1.0.2t /usr/local/opt/openssl

@jokumer

jokumer commented Oct 16, 2020

Copy link
Copy Markdown
brew uninstall --ignore-dependencies openssl
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/30fd2b68feb458656c2da2b91e577960b11c42f4/Formula/openssl.rb

ref: https://forums.meteor.com/t/mongodump-cannot-find-openssl-version-on-macos-catalina/50912/3

Currently last command errors with
Error: Calling Installation of openssl from a GitHub commit URL is disabled! Use 'brew extract openssl' to stable tap on GitHub instead.

This worked for me

brew uninstall --ignore-dependencies openssl

Download https://raw.githubusercontent.com/Homebrew/homebrew-core/30fd2b68feb458656c2da2b91e577960b11c42f4/Formula/openssl.rb

brew install ./openssl.rb

@jzohrab

jzohrab commented Nov 7, 2020

Copy link
Copy Markdown

Thanks @jokumer, your solution works for Catalina 10.15.7:

brew uninstall --ignore-dependencies openssl
curl https://raw.githubusercontent.com/Homebrew/homebrew-core/30fd2b68feb458656c2da2b91e577960b11c42f4/Formula/openssl.rb > openssl.rb
brew install ./openssl.rb

@hasibaasma

Copy link
Copy Markdown

Thanks @jokumer, your solution works for Catalina 10.15.7:

brew uninstall --ignore-dependencies openssl
curl https://raw.githubusercontent.com/Homebrew/homebrew-core/30fd2b68feb458656c2da2b91e577960b11c42f4/Formula/openssl.rb > openssl.rb
brew install ./openssl.rb

This worked for me! Thanks

@jokumer

jokumer commented Nov 30, 2020

Copy link
Copy Markdown

I forgot that curl thing. Thx for contributing by comment

@will

will commented Dec 29, 2020

Copy link
Copy Markdown

working homebrew openssl postgres configure (just stuffing keywords for future searchers)

./configure prefix=/tmp/pg --with-openssl --with-libs=/usr/local/opt/openssl/lib --with-includes=/usr/local/opt/openssl/include

@lelodois

Copy link
Copy Markdown

this command solve my problem on github CI job:
cp /usr/local/opt/openssl@1.1/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/

Me tooo thanks :)

@anantonton

Copy link
Copy Markdown

@vcjuliocesar Did you try downgrading your openSSL as I mentioned in the comment before:

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

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.

This is working for me!

ANDDDDD... after accidentally upgraded openssl (and brew), this is no longer working for me. somehow.

But I find this working (no need to do the last step - brew switch... )

aisingapore/TagUI#635 (comment)

@jeromeof

Copy link
Copy Markdown

Great work - but when I try the app (after giving it permission etc) - I get the following error popup:

Unable to load OpenSSL library files: libssl.1.1.dylib and libcrypto.1.1.dylib

@bio-informatician

Copy link
Copy Markdown

If you are using a conda env, simply use

conda install -c bioconda samtools openssl=1.0

@arkakkar

arkakkar commented Apr 8, 2021

Copy link
Copy Markdown

thanks

@CrowleyRajapakse

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

when you perform this export commands in the terminal above issue got resolved for me.

@elahmo

elahmo commented May 30, 2021

Copy link
Copy Markdown

is there a way to make this work on M1 Macs with BigSur?

@drone1

drone1 commented Jun 8, 2021

Copy link
Copy Markdown

Yes please :(

is there a way to make this work on M1 Macs with BigSur?

@corismall

Copy link
Copy Markdown

me too! Although I'm using an Intel core desktop with BigSur. I'm hesitant to downgrade.

@ever-dev

ever-dev commented Jul 12, 2021

Copy link
Copy Markdown

In M1 chip computers, the installations are placed in /opt/homebrew/opt instead of /usr/local/opt.
So we should use the following:

export LDFLAGS="-L/opt/homebrew/opt/curl/lib -L/opt/homebrew/opt/openssl/lib"
export CPPFLAGS="-I/opt/homebrew/opt/curl/include -I/user/local/opt/openssl/include"

@klaus4

klaus4 commented Dec 19, 2021

Copy link
Copy Markdown

<CrowleyRajapakse commented on 22 Apr>
For compilers to find openssl@1.1 you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
πŸ‘

@DWmelon

DWmelon commented Aug 10, 2022

Copy link
Copy Markdown

thanks, it work for me

@elfgoh

elfgoh commented Aug 29, 2022

Copy link
Copy Markdown

this command solve my problem on github CI job: cp /usr/local/opt/openssl@1.1/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/

On M1 seems like I can make to with $ ln -s /opt/homebrew/opt/openssl\@1.1/lib/pkgconfig/libcrypto.pc /usr/local/lib/pkgconfig/libcrypto.pc

ghost commented Oct 24, 2022

Copy link
Copy Markdown

@elfgoh thanks, this worked for me!

@EhsanZ

EhsanZ commented Nov 5, 2023

Copy link
Copy Markdown

In M1 chip computers, the installations are placed in /opt/homebrew/opt instead of /usr/local/opt. So we should use the following:

export LDFLAGS="-L/opt/homebrew/opt/curl/lib -L/opt/homebrew/opt/openssl/lib"
export CPPFLAGS="-I/opt/homebrew/opt/curl/include -I/user/local/opt/openssl/include"

Thank you very much πŸ™

@BrianODell

Copy link
Copy Markdown

for what it's worth, I got through a compile (v2.48) with:

./configure LDFLAGS=-L/opt/homebrew/lib/ CFLAGS="-I/opt/homebrew/include"

on my M1 mac. Zero symlinks or copying of files!

@joelparkerhenderson

Copy link
Copy Markdown

In case anyone here is trying this on macOS with brew and the toolmise or `asdf , this is what worked for me:

brew install gcc readline zlib curl openssl@1.1 ossp-uuid icu4c pkg-config
PKG_CONFIG_PATH="$(brew --prefix)/lib/pkgconfig:$(brew --prefix icu4c)/lib/pkgconfig" \
LDFLAGS="-L$(brew --prefix)/lib" \
CPPFLAGS="-I$(brew --prefix)/include" \
mise use postgres@17 --verbose

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