libgit2 / libgit2/libgit2sharp
LibGit2Sharp.LibGit2SharpException: certificate revocation status could not be verified
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 925
- PR merge metrics
- No merged PRs in 30d
Description
Hello
I am like many behind a corporate firewall for outbound access.
I am using LibGit2Sharp as a dependency of another tool Aspire.PolyRepo.
I am getting this error:
Unhandled exception. LibGit2Sharp.LibGit2SharpException: certificate revocation status could not be verified
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 823
I have tried:
git config --global http.sslVerify false
I have as well put the callback for certificate check during clone operations like this:
var co = new CloneOptions();
co.FetchOptions.CertificateCheck += delegate (Certificate certificate, bool valid, string host)
{
return true;
};
Claude AI was proposing other things like the following to get this to work:
// Set multiple environment variables to bypass SSL verification
Environment.SetEnvironmentVariable("GIT_SSL_NO_VERIFY", "1");
Environment.SetEnvironmentVariable("GIT_SSL_CAINFO", "");
Environment.SetEnvironmentVariable("GIT_CURL_VERBOSE", "1");
// Disable certificate validation globally for .NET HttpClient
ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;
ServicePointManager.CheckCertificateRevocationList = false;
Is there anything else I can try to get this great library to function ?
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the clone call in Repository.cs and follow the certificate-related error through Proxy.cs and Ensure.cs. Review how CloneOptions.FetchOptions.CertificateCheck is handled for this failure, using the reported stack trace and corporate-firewall setup as the reproduction context. Done means identifying whether the library can handle this revocation error and documenting or testing the supported behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, git
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100