I am using LibGit2Sharp in a custom git client, works fine on my machine but when I run the same code on a different machine with the same credentials I am getting the error:
unknown certificate lookup failure: 16777280
I’ve done some googling and looks like its something to do with the authentication certificates but as I’m cloning HTTPS I thought providing the username and password of the gitlab user is enough?
Anyways, can anyone guide me on a resolution here? This is a little above my knowledge and first time using a git API.
Here is the code I’m using. To reiterate, it works perfectly on my own machine but not on another.
public void Clone()
{
// Notify about the cloning process initiation
this.OnUpdate?.Invoke(this, new OnUpdateEventArgs
{
Severity = LogType.Info,
Message = $"Cloning the repository {this.RepositoryInfo.Name}"
});
try
{
// Clone the repository with credentials
Repository.Clone(this.RepositoryInfo.RemoteRepository, this.RepositoryInfo.LocalRepository.FullName,
new CloneOptions
{
FetchOptions = { CredentialsProvider = (url, user, cred) => new UsernamePasswordCredentials { Username = this.Author.Credentials.UserName, Password = this.Author.Credentials.Password } }
});
// Notify about the successful cloning
this.OnUpdate?.Invoke(this, new OnUpdateEventArgs
{
Severity = LogType.Success,
Message = "Repository cloned successfully."
});
}
catch (Exception e)
{
// Notify about the error during cloning
this.OnUpdate?.Invoke(this, new OnUpdateEventArgs
{
Severity = LogType.Error,
Message = Errors.GetErrorString(86) + " : " + e.Message
});
}
}