I've used HttpWebRequests to post data to HTTPS websites before, and I've never had todo anything different than a regular HTTP Post.
Does anyone know if there are any tricks involved that I missed to ensure that this is done properly?
After a little searching, it looks like you don't have to do anything if the certificate is valid.
If you want to examine the certificate yourself, you can do this:
System.Net.ServicePointManager.ServerCertificateValidationCallback +=
delegate(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate,
System.Security.Cryptography.X509Certificates.X509Chain chain,
System.Net.Security.SslPolicyErrors sslPolicyErrors)
{
return true; // **** Always accept
};
The above code came from a comment on Rick Stralhs blog, and will force always accepting the client cert.
You can also validate the cert there in that delegate.
Cool stuff!
Check for certification errors, this i a common issue http://www.west-wind.com/weblog/posts/48909.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With