libgit2 / libgit2/libgit2sharp

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

Open
#2,106 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.5k
Forks
925
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Windows 10, .NET 8.0 case with LibGit2Sharp v0.30.0, using CloneOptions, FetchOptions.CertificateCheck, and Repository.Clone as shown. Trace the certificate callback and the source of “unknown certificate lookup failure: 33”; done means the reported GitLab clone behavior is understood and the intended certificate-check handling is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, git
Domain
security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.