Refusing to link: openssl
Linking keg-only OpenSSL means you may end up linking against the insecure,
deprecated system version while using the headers from the Homebrew version.
Instead, pass the full include/library paths to your compiler e.g.:
-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib
Solution!!!
uninstalled openssl 1.0.2 and installed 1.0.1 also with homebrew. Dotnet new/restore/run then worked fine.
Uninstall openssl
brew uninstall opensll
Install openssl 101:
brew install homebrew/versions/openssl101
Linking:
brew link --force homebrew/versions/openssl101
The fix above isn't working for me on El Capitan.
Warning: Refusing to link: openssl101
Linking keg-only openssl101 means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's openssl101.
Instead, pass the full include/library paths to your compiler e.g.:
-I/usr/local/opt/openssl101/include -L/usr/local/opt/openssl101/lib
This article helps me on EL Capitan.
https://solitum.net/openssl-os-x-el-capitan-and-brew/
binlufluxx still same error.
@Vinayk93 @df-jsykes This is the only thing that worked for me: https://github.com/rbenv/ruby-build/issues/898#issuecomment-240894957
only solution is to install rvm and do all the installation through rvm
@Vinayk93 Cool if that works for you. I should mention that I don't use dotnet. I was having the same problem without ever having used dotnet. I just replied because I was having similar OpenSSL problems when installing new versions of ruby with rvm or rbenv. Thought somebody could use this information. Do as you wish.
@HZH1907 @binlufluxx I still get the same error. I am on macOS Sierra though.
https://github.com/dotnet/corefx/issues/9394 tracked removing the hard dependency on OpenSSL from .NET Core 2.0. That work is now complete, so the next version won't have to workaround this problem.
For prosperity, the official workaround we recommended is:
brew update
brew install openssl
mkdir -p /usr/local/lib
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
(which assumes default Homebrew paths)
FWIW, using echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc
per the Homebrew OpenSSL 1.0.2k post-install instructions worked for what I was trying to do... may work for others as well.
This fixed it for me after I've tried nearly everything else:
https://github.com/rvm/rvm/issues/3724#issuecomment-236233724
Most helpful comment
@HZH1907 @binlufluxx I still get the same error. I am on macOS Sierra though.