Discussions  >  SharpSvn Community Support and Feedback  >  [SharpSvn] "certificate verification failed" exception

Hide all messages in topic

All messages in topic

RE: [SharpSvn] "certificate verification failed" exception RE: [SharpSvn] "certificate verification failed" exception

Author ansarisufiyan (OCN Member)
Full name Sufiyan Ansari
Date 2010-04-21 00:18:57 PDT
Message Here is the code that I have tried. However this is not working when I perform SharpSVN commands.

SvnClient objSvnClient = new SvnClient();

// Add an SslServerTrustHandlers event
objSvnClient.Authent​ication.SslServerTru​stHandlers += new EventHandler<Shar​pSvn.Security.SvnSsl​ServerTrustEventArgs​>(Authentication_​SslServerTrustHandle​rs);

// Function to handle SSL Certification issue. This function is a page level function since it is binded with SharpSVN's SslServerTrustHandlers event.
private void Authentication_SslSe​rverTrustHandlers(ob​ject sender, SharpSvn.Security.Sv​nSslServerTrustEvent​Args 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
    }

RE: [SharpSvn] "certificate verification failed" exception RE: [SharpSvn] "certificate verification failed" exception

Author ansarisufiyan (OCN Member)
Full name Sufiyan Ansari
Date 2010-04-21 00:17:13 PDT
Message Can anybody tell me how we can make "SslServerTrustHandlers" event bind on the page load event so that we don't need to right the same event handling code in all the places where we are performing SharpSVN commands. Thanks in advance.

RE: [SharpSvn] "certificate verification failed" exception RE: [SharpSvn] "certificate verification failed" exception

Author quirijn (OCN Member)
Full name Quirijn Slings
Date 2009-02-10 14:31:11 PST
Message Great Bert, that did the trick. Thanks.
Quirijn

RE: [SharpSvn] "certificate verification failed" exception RE: [SharpSvn] "certificate verification failed" exception

Author rhuijben (OCN Member)
Full name Bert Huijben
Date 2009-02-06 20:04:50 PST
Message > -----Original Message-----
> From: Quirijn Slings [mailto:quirijnsling​XXXX@XXXX]
> Sent: Saturday, February 07, 2009 1:08 AM
> To: users at sharpsvn dot open dot collab dot net; Gabe Moothart
> Subject: RE: [SharpSvn] "certificate verification failed" exception
>
> I have the same problem, due to a self-signed certificate on the
> server. I tried using the AddExpectedError, like this:
> SvnCheckOutArgs coArgs = new SvnCheckOutArgs();
> coArgs.AddExpectedEr​ror(SvnErrorCode.SVN​_ERR_RA_DAV_REQUEST_​FAILED);
> client.CheckOut(target, workdir, coArgs);

You can handle the .SslServerTrustHandlers event on the SvnAuthentication
class.

using(SvnClient cl = new SvnClient())
{
   cl.Authentication.Ss​lServerTrustHandlers​ +=
    delegate(object sender, 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
    };

   // And now just use cl like you normally would on the first
authentication
   // failed the delegate is called
}

If you are working on a Windows Forms program I would suggest linking to
SharpSvn.UI and
calling
SvnUI.Bind(cl, MainForm);

Then you get a default UI on all authentication request types. (Including
the certificate authentication, etc.)

    Bert

RE: [SharpSvn] "certificate verification failed" exception RE: [SharpSvn] "certificate verification failed" exception

Author quirijn (OCN Member)
Full name Quirijn Slings
Date 2009-02-06 16:08:17 PST
Message I have the same problem, due to a self-signed certificate on the server. I tried using the AddExpectedError, like this:
SvnCheckOutArgs coArgs = new SvnCheckOutArgs(); coArgs.AddExpectedEr​ror(SvnErrorCode.SVN​_ERR_RA_DAV_REQUEST_​FAILED);
                        client.CheckOut(target, workdir, coArgs);


That made the exception go away, but it still doesn't check out anything..

Any help is thoroughly appreciated.

[SharpSvn] "certificate verification failed" exception [SharpSvn] "certificate verification failed" exception

Author gmoothart (OCN Member)
Full name Gabe Moothart
Date 2008-12-22 09:12:48 PST
Message Hi,
I apologize if this is a FAQ, but I couldn't find the answer anywhere. When I try to connect to my repository to do an import, I get this exception:

SvnRepositoryIOException was unhandled:
OPTIONS of <repository path>: Server certificate verification failed: issuer is not trusted

How can I tell SharpSvn that I want to ignore this error? The code I'm using is this:

var importArgs = new SvnImportArgs {LogMessage = "Initial import"};
  if (!svnClient.Import(dir, uri, importArgs))
    ...

TIA,
Gabe
Messages per page: