SharpSVN - Server Certificate Error

I am using SharpSVN and I am adding a folder to subversion. Then I try to fix this, and I get this exception:

SharpSvn.SvnRepositoryIOException: OPTIONS of 'https://sth.com/svn/blah/Documents': Server certificate verification failed: certificate has expired, certificate issued for a different hostname, issuer is not trusted

As far as I can see here: Server certificate error

.. it seems that I should use the --trust-server-cert option, but I do not see this in the SvnCommitArgs arguments.

In addition, I found the following: How to use a custom certificate authority in SharpSvn without installing a certificate

.. where I see this:

 client.Configuration.SetOption(...) 

But I do not know what settings I should provide in order to do this without problems.

Has anyone done something like this?

EDIT : I also tried to do this:

 client.Authentication.SslServerTrustHandlers += new EventHandler<SharpSvn.Security.SvnSslServerTrustEventArgs>(Authentication_SslServerTrustHandlers); void Authentication_SslServerTrustHandlers(object sender, SharpSvn.Security.SvnSslServerTrustEventArgs e) { // Accept ceritificate here? } 

But I do not understand what I have to do inside the handler in order to accept the certificate ... :(

+6
source share
1 answer

OK I solved this problem and now I get another error. What you need to do is:

  client.Authentication.SslServerTrustHandlers += new EventHandler<SharpSvn.Security.SvnSslServerTrustEventArgs>(Authentication_SslServerTrustHandlers); void Authentication_SslServerTrustHandlers(object sender, SharpSvn.Security.SvnSslServerTrustEventArgs e) { // Look at the rest of the arguments of E, whether you wish to accept // If accept: e.AcceptedFailures = e.Failures; e.Save = true; // Save acceptance to authentication store } 
+10
source

Source: https://habr.com/ru/post/947724/


All Articles