Guest User

Untitled

a guest
Aug 5th, 2012
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. SslStream client unable to complete handshake with stunnel server
  2. X509Certificate cert = new X509Certificate2(filename, password);
  3. X509CertificateCollection certColl = new X509CertificateCollection();
  4. certColl.Add(cert);
  5.  
  6. sslStream.AuthenticateAsClient(serverName);
  7.  
  8. SslStream sslStream = new SslStream(
  9. client.GetStream(),
  10. false,
  11. new RemoteCertificateValidationCallback(ValidateServerCertificate),
  12. new LocalCertificateSelectionCallback(SelectLocalCertificate));
  13.  
  14. sslStream.AuthenticateAsClient(serverName);
  15.  
  16. sslStream.AuthenticateAsClient(serverName,
  17. certColl,
  18. SslProtocols.Tls,
  19. true);
  20.  
  21. Element certificate is valid: False
  22. Element error status length: 1
  23.  
  24. error 18 at 0 depth lookup:self signed certificate
  25. OK
Advertisement
Add Comment
Please, Sign In to add comment