6

I'd like to use SharpSVN with a different user of TortoiseSVN.
I'm using VisualSVN as server and I'm connecting to VisualSVN using https. In TortoiseSVN the url is https://<myserver>.
Reading around I've found some possible solutions.

client.Authentication.ForceCredentials(user, password);

This definitively changes the TortoiseSVN cache but actually it is the only method to authenticate that works for me.

Methods that starts with

client.Authentication.Clear();

In this case, when I use the client I receive the error

Unable to connect to a repository at URL 'https://myserver'
No provider registered for 'svn.ssl.server' credentials

bubi
  • 6,414
  • 3
  • 28
  • 45

1 Answers1

0

You should use this code

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;
 };
shuraz
  • 11
  • 2
    Welcome to Stack Overflow! Please don't answer just with source code. Try to provide a nice description about how your solution works. See: [How do I write a good answer?](https://stackoverflow.com/help/how-to-answer). Thanks – sɐunıɔןɐqɐp Aug 04 '18 at 10:48
  • @shuraz thanks for your answer. I already try it and the delegate is never called. Also, with ForceCredentials in my case the credential cache is overwritten. – bubi Aug 04 '18 at 17:13