You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
The function Repository.ListRemoteReferences needs a new parameter to validate server certificate #2133
The function "Repository.ListRemoteReferences" needs a new parameter "CertificateCheckHandler CertificateCheck" to let the user validate the server certificate, because now the function fails with the error "certificate revocation status could not be verified".
Version of LibGit2Sharp = 0.31.0
Operating system: Windows 10 Pro 64 bits
Framework: NET Framework 4.7.2
I've got a similar problem, ListReferences fails with certificate revocation status could not be verified.
This is the code is use:
using var repo = new Repository( project.LocalDir );
var remote = repo.Network.Remotes["origin"];
var credentials = GetGitCredentials();
remoteRefs = repo.Network.ListReferences( remote.Url,
( _, _, _ ) => new UsernamePasswordCredentials { Username = credentials.Username, Password = credentials.Password } );
private Credential GetGitCredentials()
{
var store = new SecretStore( "git" );
var auth = new BasicAuthentication( store );
var credentials = auth.GetCredentials( new( ConstantValues.GitLabUrl ) );
return credentials;
}
Full exception:
System.Exception: All retries failed
---> 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.Proxy.git_remote_connect(RemoteHandle remote, GitDirection direction, GitRemoteCallbacks& remoteCallbacks, GitProxyOptions& proxyOptions) in /_/LibGit2Sharp/Core/Proxy.cs:line 2172
at LibGit2Sharp.Network.ListReferences(String url, CredentialsHandler credentialsProvider, ProxyOptions proxyOptions) in /_/LibGit2Sharp/Network.cs:line 193
Activity
bording commentedon Dec 5, 2024
Can you provide a way to reproduce the problem? Code but also a repository to interact with that causes the issue?
Dave-Senn commentedon Mar 13, 2026
I've got a similar problem,
ListReferencesfails withcertificate revocation status could not be verified.This is the code is use:
Full exception:
I can't provide a full working repro since it involves a certain git server + certificate constellation.
An option for a custom certificate validation could be a fix for the problem, something like: https://learn.microsoft.com/en-us/dotnet/api/system.net.security.remotecertificatevalidationcallback?view=net-10.0