Closed Ay1000 closed 7 months ago
Hi @bording
Do you have any ideas, a direction for me perhaps?
downgraded to 6.0-alpine3.16 which still has the OLD openssl libraries, that fixed the problem.
But this still leaves us with security issues. So will leave this ticket open
ps:
@Ay100 If the latest preview isn't working, then there's likely nothing that can be done at the LibGit2Sharp level, but would need some sort of change at the libgit2 level.
libgit2 dynamically loads the OpenSSL dependency, so if that code isn't working, it would need to change there.
Do you know what's different about OpenSSL between the two docker images?
I'm also facing the same issue, however I have a working version on .net 7.0.1 using alpine 3.16 and the broken version is .net 7.0.2 using alpine 3.17 so I'm going to say the most likely place of the issue is from the new alpine version which includes OpenSSL3 as the default OpenSSL version.
It looks like someone is currently working on this support on libgit2 https://github.com/libgit2/libgit2/commit/f02bcf721105d3dfb0a7d12dec2816b495451c45
@Ay1000 Installing the openssl1.1-compat package seems to resolve the issue for me. using the mcr.microsoft.com/dotnet/aspnet:7.0-alpine image
As I suspected, this appears to be related to the version of OpenSSL that the newer version of Alpine is using, and it not being supported by libgit2 yet: https://github.com/libgit2/libgit2/pull/6471
In case you haven't already tried the newer releases, this should be resolved now.
Reproduction steps
Try to Clone a Git repo from a .net 7 project running in a mcr.microsoft.com/dotnet/aspnet:7.0-alpine image.
Expected behavior
Clone successful
Actual behavior
Error: LibGit2Sharp.LibGit2SharpException: could not load ssl libraries at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in //LibGit2Sharp/Core/Ensure.cs:line 154 at LibGit2Sharp.Core.Ensure.ZeroResult(Int32 result) in //LibGit2Sharp/Core/Ensure.cs:line 172 at LibGit2Sharp.Core.Proxy.gitclone(String url, String workdir, GitCloneOptions& opts) in //LibGit2Sharp/Core/Proxy.cs:line 278 at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options) in /_/LibGit2Sharp/Repository.cs:line 793
Version of LibGit2Sharp (release number or SHA1)
0.27.0-preview-0182
Operating system(s) tested; .NET runtime tested
mcr.microsoft.com/dotnet/aspnet:7.0-alpine