2013-06-20 2 views
6

SharpSVN을 사용하고 전복에 폴더를 추가합니다. 그리고 나는 그것을 저지하려고 나는이 예외 얻을 :SharpSVN - 서버 인증서 확인에 실패했습니다.

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

지금까지 내가 여기에서 볼 같이 보인다 가깝지만 Server certificate verification failed

가 나는 --trust-server-cert 옵션을 사용해야합니다,하지만 난 돈 '을 인수는 SvnCommitArgs의 어느 위치 에나 표시됩니다.

또한, 나는이를 발견 :이 볼 ..where How do I use a custom Certificate Authority in SharpSvn without installing the certificate

:

client.Configuration.SetOption(...) 

하지만 나는 그것이 문제없이 저지하기 위해 제공해야합니다 어떤 설정 모른다.

비슷한 일을 한 사람이 있습니까?

편집 : 나는이 일을 시도 :

client.Authentication.SslServerTrustHandlers += new EventHandler<SharpSvn.Security.SvnSslServerTrustEventArgs>(Authentication_SslServerTrustHandlers); 

    void Authentication_SslServerTrustHandlers(object sender, SharpSvn.Security.SvnSslServerTrustEventArgs e) 
    { 
     // Accept ceritificate here? 
    } 

을하지만 ... 내가 인증서를 받아 핸들러 내부에서 무엇을해야하는지 :(

답변

10

확인을 이해하지 못하는 ..

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 
    } 
+1

당신은 또한보고 확인 :이 문제를 해결하고 지금은 다른 오류가 무엇을 당신이해야 할 것은 이것이다 "E"의 다른 인수와 확인. 이렇게하면 * 모든 * SSL 인증서 (만료, 해지 등) –

관련 문제