0

Application I wrote is having trouble "creating a SSL/TLS channel" to a server but browsers on the same machine are not having any problems with the website.

To troubleshoot this, I'd created the following "dumbed down" code to test for this very specific issue.

    try {
        var myRequest = (HttpWebRequest)WebRequest.Create(url);

        var response = (HttpWebResponse)myRequest.GetResponse();

        if (response.StatusCode == HttpStatusCode.OK) {
            Console.Write(string.Format("{0} Available", url));
        } else {
            Console.Write(string.Format("{0} Returned, but with status: {1}", url, response.StatusDescription));
        }
    } catch (Exception ex) {
        Console.Write(string.Format("{0} unavailable: {1}", url, ex.Message));
    }

This is still giving me a "Could not create SSL/TLS channel" exception. A wireshark analysis of both of these scenarios shows that the browsers Client Hello packet contains 20 cipher suites, while the application's Client Hello only has 4. I'm thinking this could be the problem but am not sure how it is happening or how to stop it from happening.

To confound it more, this code works from another machine just fine.

Rubix Rechvin
  • 571
  • 3
  • 16
  • Maybe you need to accept the certificate? Like in this example: http://stackoverflow.com/questions/560804/how-do-i-use-webrequest-to-access-an-ssl-encrypted-site-using-https – Niklas Apr 24 '15 at 14:38
  • Doesn't look like that's the case, I tried adding the recommended code and got the same result. – Rubix Rechvin Apr 24 '15 at 14:49

0 Answers0