Network Topics include: sockets, protocols and the web

Go Back  Xtreme .NET Talk > .NET > Network > Bad/Invalid Certificate


Reply
 
Thread Tools Display Modes
  #1  
Old 07-21-2003, 09:49 AM
ccc ccc is offline
Newcomer
 
Join Date: Dec 2002
Posts: 8
ccc is on a distinguished road
Unhappy 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.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can you install a SSL Certificate into a user's 'certificate store'? trend General 1 04-19-2006 04:05 AM
how can I send a certificate with a request in debug mode? kilobyte ASP.NET 0 04-20-2005 08:28 AM
bad bad System.MethodAccessException ! LDV General 1 07-05-2004 04:58 AM
Import certificate from a SSL WebServer using thick client Night General 0 05-06-2003 06:21 AM

Advertisement:







Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe