question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Self Contained Publish & MacOS Store Submission (System.Security.Cryptography.Native.OpenSsl.dylib)

See original GitHub issue

Background

I am currently building a cross platform Electron app that uses a .NET Core and Kestrel for a localhost WebAPI for .NET Core to do the lifting & processing that will communicate over HTTP in the HTML/JS of the Electron application.

Building the application and running this works perfectly fine, however when the application is submitted to Apple’s AppStore for Review I get the following error from them.

Response from Apple’s App Review Team 🍎

Your app uses or references the following non-public APIs: Symbols: _EVP_sha384, _EVP_sha256, _EVP_sha512 From framework: @rpath/libcrypto.1.0.0.dylib In binary: >Contents/Resources/LogViewer.Server/bin/dist/osx/System.Security.Cryptography.Native.OpenSsl.dylib

As System.Security.Cryptography is part of the .NET Core framework that I need to ship & bundle as part of the application (as I have no guarantee of .NET Core being installed on users machines)

Are there any suggestions on what I can do? Thanks 😃

Steps to reproduce ⚒

If you wish you can clone my repository for the project here https://github.com/warrenbuckley/Compact-Log-Format-Viewer/

In the LogViewer.Server folder run the dotnet CLI publish command as follows: dotnet publish --runtime osx-x64 --output bin/dist/osx

CSProj & Nuget References

<Project Sdk="Microsoft.NET.Sdk.Web">
  
  <PropertyGroup>
    <!--<RuntimeIdentifiers>win10-x64;osx.10.11-x64</RuntimeIdentifiers>-->
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.0" />
    <PackageReference Include="Serilog.Filters.Expressions" Version="2.0.0" />
    <PackageReference Include="Serilog.Formatting.Compact.Reader" Version="1.0.3" />
    <PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
  </ItemGroup>

</Project>

Environment data

dotnet --info output:

.NET Core SDK (reflecting any global.json):
 Version:   2.2.104
 Commit:    73f036d4ac

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.14
 OS Platform: Darwin
 RID:         osx.10.14-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.2.104/

Host (useful for support):
  Version: 2.2.2
  Commit:  a4fd7b2c84

.NET Core SDKs installed:
  2.1.4 [/usr/local/share/dotnet/sdk]
  2.1.302 [/usr/local/share/dotnet/sdk]
  2.1.504 [/usr/local/share/dotnet/sdk]
  2.2.104 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.8 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
livarcocccommented, Mar 14, 2019

I guess you could try a trimmer, something like this:

dotnet add package Microsoft.Packaging.Tools.Trimming -v 1.1.0-preview1-25818-01
dotnet publish -runtime osx-x64 --output bin/dist/osx /p:TrimUnusedDependencies=true

But as you can see, it is currently a preview and hasn’t an official release, but maybe solves your problem.

0reactions
bartonjscommented, Apr 15, 2019

We have lightup support for using OpenSSL as an optional component via RSAOpenSsl, DSAOpenSsl, ECDsaOpenSsl and ECDiffieHellmanOpenSsl.

Unless a project is using those types specifically OpenSSL won’t get touched.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to load DLL 'System.Security.Cryptography.Native. ...
OpenSsl': The specified module could not be found. My publish folder contain the "System.Security.Cryptography.Native.OpenSsl.dylib". This link ...
Read more >
Visual Studio for Mac plans for Apple M1 / ARM-based ...
As part of this, will you enable debugging of iOS apps as native M1 apps too pls. Xcode supports this, but currently we...
Read more >
Cross-platform cryptography in .NET Core and .NET 5
On macOS, RSAOpenSsl works if OpenSSL is installed and an appropriate libcrypto dylib can be found via dynamic library loading. If an ...
Read more >
dot net core 3.1 library project presents a huge list of ...
I created a new .net core 3.1 library project and tried installing xunit nuget package. The dependencies show: *Any.Version=v0.0 xunit.core ...
Read more >
Consolidated JDK 8 Release Notes
Native GSS automatically uses cached credentials from operating systems, thus the javax.security.auth.useSubjectCredsOnly system property should be set to false ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found