【问题标题】:SharpSVN authentication without affecting TortoiseSVN credentialsSharpSVN 身份验证而不影响 TortoiseSVN 凭据
【发布时间】:2018-08-04 18:40:00
【问题描述】:

我想与其他 TortoiseSVN 用户一起使用 SharpSVN。
我使用 VisualSVN 作为服务器,并使用 https 连接到 VisualSVN。在 TortoiseSVN 中,网址是 https://<myserver>
环顾四周,我找到了一些可能的解决方案。

client.Authentication.ForceCredentials(user, password);

这确实改变了 TortoiseSVN 缓存,但实际上它是唯一适合我的身份验证方法。

开头的方法

client.Authentication.Clear();

在这种情况下,当我使用客户端时收到错误消息

无法连接到位于 URL“https://myserver”的存储库
没有为“svn.ssl.server”凭据注册提供程序

【问题讨论】:

    标签: c# authentication svn sharpsvn


    【解决方案1】:

    你应该使用这个代码

    client = new SvnClient();
    client.Authentication.ForceCredentials(login, password);
    client.Authentication.SslServerTrustHandlers += delegate (object sender, SharpSvn.Security.SvnSslServerTrustEventArgs e)
     {
       e.AcceptedFailures = e.Failures;
       e.Save = true;
     };
    

    【讨论】:

    • 欢迎来到 Stack Overflow!请不要只用源代码回答。尝试对您的解决方案如何工作提供一个很好的描述。请参阅:How do I write a good answer?。谢谢
    • @shuraz 感谢您的回答。我已经尝试过了,并且从未调用过代表。此外,在我的情况下,使用 ForceCredentials 会覆盖凭证缓存。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-12-02
    • 2012-10-01
    • 2017-12-31
    • 2013-04-11
    • 1970-01-01
    • 2018-03-25
    • 2015-06-01
    相关资源
    最近更新 更多