In the validation callback, you need to decide if you are ready to connect to the site, depending on the certificate returned to you.
For eg, assume you are going to "foo.com" . This site might have a certificate with a different common name for eg: "bar.com" . If you still want to connect, you need to implement the cert validation callback.
The default validation callback will make sure that the DNS hostname of the server matches the certificate subject, and makes sure that the certificate is issued by a valid certification authority, and it is not expired, etc. You need to implement your own callback in cases where you know for sure that the cert wont be valid, and that the server is a known good server, for eg: you trust the server, inspite of the certificate.
feroze.
feroze
--
My blog