Description
Reproduction steps
providing valid credential to the CredentialProvider using the below snippet
cloneOptions.FetchOptions.CredentialsProvider = (url, usernameFromUrl, password) =>
new UsernamePasswordCredentials{ Username = gitCredential.UserName, Password = gitCredential.Password };
cloneOptions.FetchOptions.CertificateCheck = (certificate, valid, host) => true;
Repository.Clone(Credential.RepositoryUrl, workingDirectory, cloneOptions);
Expected behavior
Should clone the repository to the working directory.
Actual behavior
LibGit2Sharp.LibGit2SharpException: could not initialize security context:
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.git_clone(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 824
Version of LibGit2Sharp (release number or SHA1)
v0.30.0
Operating system(s) tested; .NET runtime tested
.NET8, windows OS