libgit2sharp icon indicating copy to clipboard operation
libgit2sharp copied to clipboard

Disable SSL Certificate Check: 'unknown certificate lookup failure: 33'

Open JialiWu7 opened this issue 1 year ago • 0 comments

I want to disable certificate verification when cloning a repo from GitLab.

The code I am using is:

var options = new CloneOptions();
options.FetchOptions.CredentialsProvider = (_url, _user, _cred) 
    => new UsernamePasswordCredentials 
    { 
        Username = "user", 
        Password = "token"
    };
options.FetchOptions.CertificateCheck += delegate (Certificate certificate, bool valid, string host)
{
    return true;
};
Repository.Clone(cloneUrl, cloneDirectoryPath, options);

But I got this error when cloning: unknown certificate lookup failure: 33

Version of LibGit2Sharp (release number or SHA1)

v0.30.0

Operating system(s) tested; .NET runtime tested

Windows 10 C# net8.0

JialiWu7 avatar Jun 18 '24 09:06 JialiWu7