Interesting problem with google RRS feed

  • Question

  • User709254202 posted
    you can call the following function with any https url and it will return the html from the page. I have tried it on over 100 different urls and they all work except for "https://adwords.google.com", which throws a WebException saying "The underlying connection was closed: Could not establish secure channel for SSL/TLS." People out their should try this themselves. They have a valid certificate. If any experts out there have any comments on why this might be the case i would love to know. (Even weirder, i can make this request fine when i use msxml) private string RequestPage(string url) { HttpWebRequest request; HttpWebResponse response; string responseText; // Create request request = (HttpWebRequest) WebRequest.Create(url); // Get response response = (HttpWebResponse) request.GetResponse(); // Read response stream responseText = new StreamReader( response.GetResponseStream(), Encoding.UTF8 ).ReadToEnd(); response.Close(); return responseText; }
    Tuesday, March 2, 2004 6:00 PM

All replies

  • User-1391363652 posted
    This is very weird. The inner exception of the thrown WebException says "The message received was unexpected or badly formatted". I though Google was simply banning unknown user agents to this specific site but after feeding it Opera's and IE's user agent strings it still didn't work. A packet sniffer shows that a handshake fails right off the bat when conencting to Google. I've seen some posts that suggest to disable TLS handshake, others suggest to make sure the ASPNET account has access to certificate stores, etc. Gotta do some more research...
    Tuesday, March 2, 2004 11:10 PM
  • User709254202 posted
    If it helps, i do know that google uses their own custom built web server.
    Tuesday, March 2, 2004 11:51 PM