473,770 Members | 2,144 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using HttpWebRequest to access SSL-enabled site, get error: Could not establish secure channel for SSL/TLS

Hi,

Specifically, the website I am trying to access is,

https://gmail.google.com/

I've read elsewhere that Google only uses SSL2, while .NET uses SSL3
and is not backward compatible. Is this true?

In any case, I want to know how this problem can be solved. The code
I'm using is dead simple,

HttpWebRequest req;
HttpWebResponse res;

req = (HttpWebRequest )HttpWebRequest .Create("https://gmail.google.co m");
res = (HttpWebRespons e)req.GetRespon se();

Any help would be greatly appreciated. Thanks.

Cheers,
Steven
Nov 16 '05 #1
4 5042
Simply implement ICertificatePol icy in your class and return true from the
'CheckValidatio nResult' method

HTH,

Alex

"Steven Pu" <re******@gmail .com> wrote in message
news:5b******** *************** **@posting.goog le.com...
Hi,

Specifically, the website I am trying to access is,

https://gmail.google.com/

I've read elsewhere that Google only uses SSL2, while .NET uses SSL3
and is not backward compatible. Is this true?

In any case, I want to know how this problem can be solved. The code
I'm using is dead simple,

HttpWebRequest req;
HttpWebResponse res;

req = (HttpWebRequest )HttpWebRequest .Create("https://gmail.google.co m");
res = (HttpWebRespons e)req.GetRespon se();

Any help would be greatly appreciated. Thanks.

Cheers,
Steven


Nov 16 '05 #2
Trebek wrote:
Simply implement ICertificatePol icy in your class and return true
from the 'CheckValidatio nResult' method


I doubt that this will help in case the underlying protocol is not
supported. Does it?

--
Joerg Jooss
jo*********@gmx .net

Nov 16 '05 #3
Hi Alex,

To tell you the truth, I really have no idea how this works - I'm
pretty new at this.

After looking up ICertifcatePoli cy, I really don't see how it helps
me. My guess is that the reason HttpWebRequest fails is due to some
kind of error/incompatibiliti es of the request itself, so shouldn't I
be changing some properties of the request object? How does
ICertificatePol icy come in?

Thanks.

Cheers,
Steven
"Trebek" <tr****@nospam. com> wrote in message news:<Ux******* ********@fe37.u senetserver.com >...
Simply implement ICertificatePol icy in your class and return true from the
'CheckValidatio nResult' method

HTH,

Alex

"Steven Pu" <re******@gmail .com> wrote in message
news:5b******** *************** **@posting.goog le.com...
Hi,

Specifically, the website I am trying to access is,

https://gmail.google.com/

I've read elsewhere that Google only uses SSL2, while .NET uses SSL3
and is not backward compatible. Is this true?

In any case, I want to know how this problem can be solved. The code
I'm using is dead simple,

HttpWebRequest req;
HttpWebResponse res;

req = (HttpWebRequest )HttpWebRequest .Create("https://gmail.google.co m");
res = (HttpWebRespons e)req.GetRespon se();

Any help would be greatly appreciated. Thanks.

Cheers,
Steven

Nov 16 '05 #4
Hi Steven,

It wont help you if you create your own CertificatePoli cy class that
accepts all certificates. The problem really is that Microsoft for
some strange reason only implemented SSL 3.0 support in
HttpWebRequest.

As you mentioned, Google runs SSL 2.0, hence the only solution is to
use another HTTP component.

I first tried PocketHTTP, which is free, and it worked really great
until i needed to do a HTTP Post with content type
"multipart/form-data". I then switched to the "IPWorks SSL V6 .Net
Edition" component (400$) and i haven't had any problems since.

Regards,

Peer

re******@gmail. com (Steven Pu) wrote in message news:<5b******* *************** ***@posting.goo gle.com>...
Hi Alex,

To tell you the truth, I really have no idea how this works - I'm
pretty new at this.

After looking up ICertifcatePoli cy, I really don't see how it helps
me. My guess is that the reason HttpWebRequest fails is due to some
kind of error/incompatibiliti es of the request itself, so shouldn't I
be changing some properties of the request object? How does
ICertificatePol icy come in?

Thanks.

Cheers,
Steven
"Trebek" <tr****@nospam. com> wrote in message news:<Ux******* ********@fe37.u senetserver.com >...
Simply implement ICertificatePol icy in your class and return true from the
'CheckValidatio nResult' method

HTH,

Alex

"Steven Pu" <re******@gmail .com> wrote in message
news:5b******** *************** **@posting.goog le.com...
Hi,

Specifically, the website I am trying to access is,

https://gmail.google.com/

I've read elsewhere that Google only uses SSL2, while .NET uses SSL3
and is not backward compatible. Is this true?

In any case, I want to know how this problem can be solved. The code
I'm using is dead simple,

HttpWebRequest req;
HttpWebResponse res;

req = (HttpWebRequest )HttpWebRequest .Create("https://gmail.google.co m");
res = (HttpWebRespons e)req.GetRespon se();

Any help would be greatly appreciated. Thanks.

Cheers,
Steven

Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1577
by: Isaac Martinez | last post by:
Hello all, I have to make a small app that will do the following. 1. Connect to a webserver and get a directory listing. 2. I have to download each file in the specified directory. 3. Once the file is downloaded, enter the data into a SQL2k database. 4. After the file is parsed, I have to delete the file. I was able to successfully complete steps 1-3 using the
4
4473
by: WATYF1 | last post by:
Hello. I'm writing a VB.NET app to check email message counts for both POP3 and IMAP4. I'm using TCPClient to connect, and a NetworkStream to send simple commands. It's a very simple bit of code, actually... the problem is, if the user is behind a proxy, then the Connect method fails (times out). How do I get around this? I thought this would be a common issue and that there would be plenty of code out there to demonstrate how to...
3
2912
by: Hardik Shah | last post by:
Hi, I am calling an ASP.Net page from an ASP classic application but need the .Net page to have access to ASP classic's session variables. I am using HTTPWebRequest to call ASP classic page which could then return the session values. But the values are always blank. If I do a Response.Redirect() to call the ASP page, it returns the values okay. But I cannot do a Response.Redirect() as I just need to access some session variables and...
3
9904
by: Jason | last post by:
I'm having a hard time getting a call to HttpWebRequest's GetRequestSteam to work. Each time I try to run it, I get the following error: The underlying connection was closed: Unable to connect to the remote server. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more
5
5875
by: japslam japslam via DotNetMonster.com | last post by:
Hi all, I have problem when I use HttpWebRequest and take long time to call to my service server. If at that time there are many request comes in semultaneous, I will get this exception System.Net.WebException: The underlying connection was closed: The request was canceled. ---> System.IO.IOException: Unable to read data from the transport connection. ---> System.ObjectDisposedException: Cannot access a disposed object named...
5
4452
by: | last post by:
Hi all, HttpWebRequest, and SoapHttpClientProtocol both expose a ClientCertificates property, which can hold multiple client certificates, but on the service side, it can only receive one client certificate, since it derives System.Web.Services.WebService class, and it's Context.Request.ClientCertificate is a single HttpClientCertificate object, is there a way to receive all the client certificates that is sent in the request? or does IIS...
5
2012
by: Dave | last post by:
What is the benefit of using "as" vs the other? HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create("http://www.contoso.com/"); vs. HttpWebRequest myReq = WebRequest.Create("http://www.contoso.com/") as HttpWebRequest;
2
9186
by: David G | last post by:
My company has a Webservice that is currently running in production. It is secured using SSL and clients are authenticated using X509 certificates. I am able to consume the Webservice methods in a Framework 2.0 c# Forms based application where I instantiate the X509 Certificate by pointing to the certificate file and passing the password: //==================== X509Certificate cert = new X509Certificate(this.tbCertFilePath.Text,...
0
1483
by: Medtondo | last post by:
I have an app that uses the events in IE (SHDocVw). I can get the DownloadComplete event etc working well, but what I would like to do is get the SSL key that IE is using for the session. What I have to do now is have IE tell me the URL that has been loaded then use the ServicePointMapper and a WebRequest to get the SSL certificate. When I know IE is at an SSL page here is a code snipet on how I get the cert //Code Start...
2
2084
by: Jeff | last post by:
ASP.NET 2.0 I'm working on a asp.net 2.0 website which needs to access a database on another server via an request. This database is placed on another server which is not based on ASP.NET, but traditional ASP. The ASP.NET may access the database on the other server by requesting a .asp page with some parameters - and hte output on the .asp page was the result from the database query... So I need to access a asp page on this other server...
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.