2013-06-20 23 views
6

Używam SharpSVN i dodajemy folder do subversion. Wtedy staram się go popełnić i otrzymuję ten wyjątek:SharpSVN - weryfikacja certyfikatu serwera nie powiodła się

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

O ile widzę tutaj: Server certificate verification failed

..To Wydaje się, że muszę użyć opcji --trust-server-cert, ale don” t zobacz to gdziekolwiek w argumentach SvnCommitArgs.

Ponadto, znalazłem to: How do I use a custom Certificate Authority in SharpSvn without installing the certificate

..where widzę tak:

client.Configuration.SetOption(...) 

Ale nie wiem jakie ustawienia muszę zapewnić, aby zobowiązać się bez problemów.

Czy ktoś zrobił coś podobnego?

EDIT: Próbowałem również w ten sposób:

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

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

Ale ja nie rozumiem, co mam czynić, wewnątrz uchwytu, aby zaakceptować certyfikat ... :(

Odpowiedz

10

OK .. i rozwiązać ten problem i teraz pojawia się inny błąd Co trzeba zrobić, to:

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

Upewnij się też, w drugi argument "E" i sprawdź. Pozwala to na * wszystkie * certyfikaty SSL (również wygasły, unieważniono itp.) –

Powiązane problemy