libgit2 / libgit2sharp

Git + .NET = ❤

Home Page:http://libgit2.github.com

Repository from Github https://github.comlibgit2/libgit2sharpRepository from Github https://github.comlibgit2/libgit2sharp

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

JialiWu7 opened this issue · 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