-
Notifications
You must be signed in to change notification settings - Fork 687
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
OmniSharp throws 'Crypto' exception on macOS 10.11 due openssl linking issue for .NET Core #676
Comments
Hi, unfortunately, the ugly "fix" you applied only works for the shared framework, which OmniSharp does not use (OmniSharp is fully self-contained). You should install and link openssl like so: ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/ |
Ok. It's very confusing for me as a user when corefx have decided to move away from OpenSSL (https://github.com/dotnet/corefx/issues/9394), corecli recommend the rpath solution, so not to break things globably (https://github.com/dotnet/cli/issues/3964#issuecomment-236493536). And omnisharp recommends the solution that might break things globally. Someone should figure out what's the best solution and actually do that. Instead users have to use two different "recommended" hacks. |
I completely agree with you! 😄 @bartonjs, @ellism: do either of you have any thoughts here? Note that OmniSharp is a stand-alone .NET Core app. So, adding an rpath as suggested by (https://github.com/dotnet/cli/issues/3964#issuecomment-236493536) won't work, since it targets the shared framework. |
@DustinCampbell your solution, also mentioned at the official page of installing extension works! |
Glad to hear it -- thanks @idchlife! |
If you have MACPorts installed: |
@haakoo: FWIW, if you want to fix this error without linking globally, you can do the following:
Note that the folder name is dependent on the version of the C# extension that have installed. So, if you update the C# extension, it'll have a new version (e.g. "ms-vscode.csharp-1.4.0") and would need to be linked again. |
@DustinCampbell I tried the install_name_tool solution after upgrading the plugin to day, and it worked. Is this something that can be added to the install-step for the plugin? |
Possibly, although the instructions for .NET Core do specify making this change globally: https://www.microsoft.com/net/core#macos. Long term, the plan is to just fix .NET Core to not use openssl on macOS. |
|
@MarlonRodriguez folks who have spent many many hours thinking about this problem decided on the instructions on https://www.microsoft.com/net/core#macos. That solution avoids the security issue. So those are what we are going to go with for now. Though you are certainly welcome to use install_name_tool if you so desire. |
@MarlonRodriguez The security risk comes from new In that thread with Homebrew there's the discussion about getting just the versioned assets linked in which they denied due to it being a niche feature, not due to it perpetuating the security problem. |
@bartonjs thank you for the explanation. I was looking at another bug report on the powershell plugin for VSCode and went down a rabbit hole. I confess I didn't put enough time in to understand the reasoning and just looked at the sample "hack" without noticing the missing version numbers. My bad. @gregg-miskelly I understand that and I certainly appreciate the help to get it working right. Notice that I did provide the same fix for MacPorts. I simply raised it as a warning since I saw the other bug. As @bartonjs explained my warning was misplaced and not valid for this fix. Thank you both for taking the time to respond. |
Thanks for this issue, helped me to work around this annoying behavior after upgrading to .NET Core 1.0.1. $ sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.1/System.Security.Cryptography.Native.dylib |
As of 1.5, OmniSharp now runs on mono. So this is no longer an issue for OmniSharp (though it is for the debugger - see #779). |
Environment data
dotnet --info
output:VS Code version: Version 1.4.0 (1.4.0)
C# Extension version: 1.3.0
OpenSSL fix
I downloaded and installed .net core using the x64.pkg.
Because of the problem with OpenSSL (which sucks), I found a "correct" fix to get it working (https://github.com/dotnet/cli/issues/3964#issuecomment-236493536):
After that I can use ´dotnet´command and I thought I was set.
Steps to reproduce
Expected behavior
Working intellisense
Actual behavior
No intellisense
OmniSharp Log:
The text was updated successfully, but these errors were encountered: