从远程专用存储库LibGit2Sharp获取列表引用

时间:2017-03-02 14:04:53

标签: c# repository ssl-certificate remote-access libgit2sharp

您好!

我想连接到私有存储库。我有登录名和密码,但程序在SSL验证中停止了。
错误:Additional information: this remote has never connected
我怎么能解决这个错误? 我的代码:

        String urls = "url";
        HttpWebRequest request = HttpWebRequest.CreateHttp(urls);
        request.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => false;
        Console.WriteLine(request.AuthenticationLevel);

        var credentials = new UsernamePasswordCredentials
        {
            Username = "user",
            Password = "password"
        };

        var remote = Repository.ListRemoteReferences("url", (url, fromUrl, types) => credentials);

        foreach (var reference in remote)
        {
            Console.WriteLine(reference.TargetIdentifier);
        }

您是否可以建议在连接到存储库时如何正确禁用检查?

1 个答案:

答案 0 :(得分:0)

一切都决定了! 错误是无视完整的服务器存储库!