Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
evilfred #1
Member since May 2010 · 1 post
Group memberships: Members
Show profile · Link to this post
Subject: StartTLS: Does agXMPP verify server certificates?
Hi,

When StartTLS is on, will agXMPP verify that the certificate provided by the server is certified for use by the server? Where would this be found in the source code?
Avatar
Alex #2
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you can validate and accept or deny the server certificate with the following code:

  1. XmppCon.ClientSocket.OnValidateCertificate += new RemoteCertificateValidationCallback(ValidateCertificate);
  2.  
  3. private bool ValidateCertificate(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors)
  4. {   
  5.     // validate the certificate and return either true or false
  6. }

Alex
Avatar
tomek #3
Member since Nov 2010 · 2 posts
Group memberships: Members
Show profile · Link to this post
Hi,
When I implement presented code, I do not receive the OnValidateCertificate event in my ValidateCertificate handler
What can be the reason?
Best Regards,
Tomek
Avatar
Alex #4
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by tomek:
What can be the reason?
no TLS enabled in your code, or the server not supporting TLS.

Alex
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