-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installing and Running on OS X 10.11 SSL Fails to Link Using Brew #6690
Comments
I have the same problem about that. |
I have the same problem about that (2). |
@lokinfey @FerHenrique Did you very recently install an OS update? When I opened my laptop yesterday, There was a pending OS update. I ran the latest update, rebooted, then tried to get dotnet core running. |
Same problem here
brew -v
|
I have the same problem about that (3),and installed OS update too. |
I follow the solution from the link below and issue is resolved. |
@chanans I followed those steps and everything is running. Thanks! I think the install instructions will have to be updated with this breaking change. |
This is related with Homebrew/brew#597 |
I followed the same instructions on the link @chanas mentioned, and I'm still getting the "Refusing to link" message. Anyone have any other ideas? |
@carlsoncoder did you set yourself as owner of the /usr/local folder?
To recap, for workaround this issue you need to:
|
@nbellocam - thanks for the quick reply. What I ended up doing (may help some others), is I found out how to just update the OpenSSL version on my Mac to latest (1.0.2h) from source. [http://bytefish.de/blog/net_core_mac_os/] Once I did this, "openssl version" reported 1.0.2h, and the dotnet new command ran without errors. I understand this might not be the BEST approach (if you had something else on your system depending on a specific version of OpenSSL), but it worked for me! |
Hi all! I uninstalled OpenSSL, installed OpenSSL 1.0.1, linked brew with OpenSSL 1.0.1, executed 'dotnet new', 'dotnet restore' and 'dotnet run'. Everything worked well. |
I think I may have been added to this conversation by mistake. Thank you, C. Hanas Teacher of Principles of Engineering On Sun, Jul 31, 2016 at 9:20 PM, Justin Carlson [email protected]
|
The stackoverflow / earlier version of openssl approach will cease working once you update brew (see Homebrew/brew#612). export DYLD_LIBRARY_PATH=/usr/local/opt/openssl/lib
dotnet new See https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryUsageGuidelines.html#//apple_ref/doc/uid/TP40001928-SW21 for info on how the library search process works on OS X. |
When the documentation gets updated it will be suggesting of manually bringing in the dylib symlinks, but not doing the rest of the work that
after doing |
Thanks Jeremy, I looked into the other option that was suggested for setting the rpath on the library. I think the following is a better solution that will only effect this specific library. sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0/System.Security.Cryptography.Native.dylib In effect, rather than telling the operating system to always use the homebrew version of SSL and potentially causing something to break, we're telling dotnet how to find the correct library. Additionally this solution can be easily incorporated into the homebrew cask version of the installation process as it should know where openssl is installed (I believe that this was your contention to this approach). As an aside, I found it a little odd that the sudo was necessary to fix this up as most things I've installed in /usr/local via homebrew are owned by "myuser:admin". Is there are reason why this is necessary / suggested for the dotnet installation? |
From the Homebrew perspective: I also agree this is a better approach. Relying on symlinks as @bartonjs has suggested may not work consistently. |
@joshka I had no idea that someone had made a dotnet installer for brew (or, at least, brew cask). This makes me feel warm and fuzzy for some reason. Asking brew where it put openssl and doing add_rpath sounds great to me when a builtin script is doing it. The problem I have with recommending that as the general approach is that the Is the uh.. cask... something that we should be maintaining and/or encouraging people to use? I'm intrigued. |
@bartonjs had it not been there already, it was next on my list of things to do. I'm thankful that someone else did it already also :) For a build-from-source user, the right thing to do is tell the build process where the libs are, whether that's installed via homebrew and living in Cellar / /usr/local/opt or installed via macports and living somewhere else. If you're building on my machine, use my libs. A quick thought experiment for you: lets say I'm a dev working on a security bug outside fix for openssl outside of the system level directories, how else would I check that dotnet is / isn't vulnerable? Alternatively I'm a .Net web developer and I want to test my site against a recently released version of openssl to ensure nothing breaks so that I can roll the fix out to production before I get pwned. See https://github.com/Homebrew/brew/blob/028d155e97014076adf4e4dbc7c888fd871de321/share/doc/homebrew/How-to-build-software-outside-Homebrew-with-Homebrew-keg-only-dependencies.md for how this fits in a build that lives outside the homebrew world, Regarding changing the library's rpath after it's installed, I think a good analogy that fits is the bindingRedirect element of your app.config in .Net. This isn't 'magic' so much as the right way to redirect versions of libraries that don't match the environment. As for the last question, IMHO yes, install should be as easy as In summary, the following make the most sense to me:
As repetition from above, my suggested fix is: sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0/System.Security.Cryptography.Native.dylib |
The only method works for me is to install from source code. Please refer to: http://bytefish.de/blog/net_core_mac_os/ |
@zh-wowtv can you please provide some insight about what in the solution above doesn't work for you? This would be helpful in providing a more generic solution to others. |
Homebrew maintainer here!
Agreed 👍
Agreed as a short-term hack but the "right" OS X solution is to bundle OpenSSL with your software. As a longish-term OS X user/dev anything that asks the user to manually to install things before installing/running it points to a badly configured installer or application bundle. |
@joshka Installing from the source code is working for me. But the other way they mentioned not working. |
@MikeMcQuaid I agree with your points there. @zh-wowtv without more information on what didn't work and how it didn't work, it's difficult to provide more assistance. Can you go into a bit more detail about what you tried and what you saw? It may help to have a read of http://www.chiark.greenend.org.uk/~sgtatham/bugs.html |
Or, in short: To help us debug this issue can you explain:
|
Fix travis build broken by openssl issue Uses fix from https://github.com/dotnet/cli/issues/3964 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/
|
Installation instructions have been updated and verified. Closing the remaining issue. |
@piotrpMSFT Homebrew maintainer here: your solution is a bad one for a few reasons so I don't think you should close this issue. These instructions will break when Homebrew upgrades to a newer version of OpenSSL so you're just delaying the inevitable, here. The right solution (as has been stated multiple times in this and other threads): if your macOS application needs a library: you ship it with the |
@piotrpMSFT I can probably find and recommend some paid macOS consultants if that would be more helpful. |
@MikeMcQuaid If Homebrew had a fixed location for where it put OpenSSL AND you used the same location as a fixed location used by MacPorts, we'd set RPATH to that. But that isn't the case. Since our current position is that we aren't bundling OpenSSL, our current instructions are the best middle-ground that we have come up with. It's all temporary, anyways, since I'm working as fast as I can to drop the OpenSSL requirement on macOS (https://github.com/dotnet/corefx/issues/9394). If you know anyone who knows C# and SecurityTransforms, send'em my way; it'll possibly speed up the effort to make this discussion moot. |
Good to know, thanks. |
@bartonjs is there an issue we can reference to track the work you're doing? |
Ok. Closing this one. Cli is just a down level dependant |
It's already close? I still getting this issue (all up to date) and I didn't see any correct step mention? |
@katopz If the instructions at https://www.microsoft.com/net/core#macos (Install pre-requisites) don't work for you please open a new issue describing what you've done and what problem you're having. |
I am also still getting this issue following the steps outlined:
more specifically I'm also trying to update python's SSL but the following is not working for me as well.
I resorted to building openssl myself following these steps: http://stackoverflow.com/a/38710248 and using |
Check the instructions again, those do not use the |
I was also returning the error Each package was returning the same message with both a
You can simply run each separate
If you have a large number of these messages as I did you could also put all the This fixed my issue and is now working as expected. |
Speaking as a long-time osx and brew user - your interim solution isn't a solution that your target audience is going to accept. I hit it when I was trying to get C# support working in Visual Studio Code. The window does tell me what's going on:
But my immediate reaction was that Visual Studio Code was doing something insane with OpenSSL. |
I have a problem about installing Visual studio Code on mac enviroment.I can not work the debugger because it gives the error like |
@erensogut Did you follow the instructions at https://www.microsoft.com/net/core#macos? |
@bartonjs Yes I did follow them but that did not work.:(When I wrote the which openssl command it gives /usr/local/bin/openssl .I thought that was a origin a problem.Is it possible |
@nbellocam I did follow you but that did not work.
The problem is : |
@ |
same issue. opensssl version returns : OpenSSL 0.9.8zh 14 Jan 2016 |
@syberkitten |
Hi, Can anyone please help me with this issue which I am getting while running dotnet on my mac? Details are as followed: .NET Command Line Tools (2.1.4) Product Information: Runtime Environment: Microsoft .NET Core Shared Framework Host Version : 2.0.5 |
@joshka regarding your comment on #6690 (comment) Do you know is there a possible alternative for this on BigSur (and M1)? It seems there is no way to handle libssl/libcrypto and make it available to be used by AesGM ecncryption. I have tried many approaches, but DYLD_LIBRARY_PATH is ignored (even with SIP disabled), and symlinks are not being read. |
Steps to reproduce
Following steps here: https://www.microsoft.com/net/core#macos
Expected behavior
System is configured
Actual behavior
$ brew link --force openssl
output:If I try to use the CLI, I get crypto errors:
$ dotnet restore
output:Environment data
dotnet --info
output:$ brew -v
output:$ brew info openssl
output:The text was updated successfully, but these errors were encountered: