Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 1881

Could not create SSL/TLS secure channel

$
0
0

Hi all,

We have some code that does a post to a https address using HttpWebResponse. It works fine on server 2003 with iis 5.x or whatever, but when we try to run it on 2008 with IIS7, it gives us the following error:

System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.

I suspected it was a certificate issue or something, so i added the ServicePointManager.ServerCertificateValidationCallback and just returned "true" but the issue still persists.

this is the relevent code:

        HttpWebRequest Req = ((HttpWebRequest)(HttpWebRequest.Create(("https://secure.[siteaddress]?" + postData))));
        Req.AllowAutoRedirect = true;
        Req.Timeout = 150000;
        Req.ProtocolVersion = HttpVersion.Version11;
        Req.ContentLength = postData.Length;
        Req.ContentType = "application/x-www-form-urlencoded";
        Req.KeepAlive = false;
        postData = "";
Req.ContentLength = postData.Length;
        Req.AllowWriteStreamBuffering = true;
        string result;

ServicePointManager.ServerCertificateValidationCallback += new System.Net.Security.RemoteCertificateValidationCallback(ValidateCertificate);

HttpWebResponse objResponse = Req.GetResponse() as HttpWebResponse;
 

any ideas as to why this is happening?

also, if we just paste the request into the address bar of a browser on the machine, it works with no errors.

 


Viewing all articles
Browse latest Browse all 1881

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>