Network Topics include: sockets, protocols and the web

Enjoy an ad free experience by logging in. Not a member yet? Register.
Go Back  Xtreme .NET Talk > .NET > Network > Bad/Invalid Certificate

Thread Tools Display Modes
Old 07-21-2003, 09:49 AM
ccc ccc is offline
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.

Dim webreq As New Net.WebClient(), by() As Byte
by = webreq.DownloadData("")
'Errors because the cert was issued to ''
System.Net.WebClient webreq = new System.Net.WebClient();
byte[] by;
by=webreq.DownloadData ("");
// Errors because the cert was issued to ''
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, 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


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


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.
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
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..