
07-21-2003, 09:49 AM
|
|
Newcomer
|
|
Join Date: Dec 2002
Posts: 8
|
|
Bad/Invalid Certificate
|
I don't know if anyone else has run into this, but if your using a webclient, or webrequest, and you goto a site with an expired/invalid SSL certificate it will error.
Example:
Code:
Dim webreq As New Net.WebClient(), by() As Byte by = webreq.DownloadData("https://paypal.com/i") 'Errors because the cert was issued to 'www.paypal.com' Debug.WriteLine(System.Text.Encoding.Default.GetString(by))
Code:
System. Net. WebClient webreq = new System. Net. WebClient(); byte[] by; by=webreq. DownloadData ("https://paypal.com/i"); // Errors because the cert was issued to 'www.paypal.com'System. Diagnostics. Debug. WriteLine (by );
Gives me a good 'System.Net.WebException: The underlying connection was closed: Could not establish trust relationship with remote server.'
Anyone know a work around (in vb or c#)? My connection must be secure (its not to paypal.com), I don't want to have to use a third party control for something that the net namespace can already do.
Thanks in advance.
|
|