Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
bilalkhan #1
Member since Oct 2016 · 81 posts · Location: Pakistan
Group memberships: Members
Show profile · Link to this post
Subject: Miniclient ClientSocket_OnValidateCertificate  SslPolicyErrors.RemoteCertificateNameMismatch
System.Net.Security.SslPolicyErrors.RemoteCertificateNameMismatch

below is my server code

  1. private void Authenticate(NetworkStream m_networkStream)
  2. {
  3.  
  4.     SslStream stream = new SslStream(m_networkStream, false, ValidateClientCertificate);
  5.     // stream.AuthenticateAsServer(cer, true, SslProtocols.Tls, false); //old line
  6.     stream.AuthenticateAsServer(cer, false, SslProtocols.Tls, false);
  7.     secureStream = stream;
  8. }
  9.  
  10. public static bool ValidateClientCertificate(object sender, X509Certificate certificate, X509Chain chain,
  11.     SslPolicyErrors sslPolicyErrors)
  12. {
  13.     return true;
  14. }

Why above sssl error occurs
This post was edited on 2016-12-29, 11:34 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
The exception is pretty clear, the hostname of the cert does not match with the remote of your socket connection.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS