Note that there are some explanatory texts on larger screens.

plurals
  1. POSSL Failures - Receiving SSL/TLS exception when using HttpWebRequest with client certificate
    primarykey
    data
    text
    <p>I have a Windows 2008 Server with IIS 7 which using a .NET C# Application to send requests to PayPal to process payments. A few months ago I installed a Certificate which was purchased by Verisign. After installation, I was able to run my WebClient code to create SSL Connections successfully, and process payments via the PayPal NVP API (Name Value Pair). </p> <p>Recently, I have been receiving an error during SSL Transaction. The specific error is as follows:</p> <p><strong>Could not create SSL/TLS secure channel</strong></p> <p>I've checked everything I could think of, and read many articles on StackOverflow and other places on the net.</p> <p>The best resource I found was this:</p> <p>The request was aborted: Could not create SSL/TLS secure channel</p> <p>Lookup the error in this article <a href="http://support.microsoft.com/kb/915599" rel="nofollow noreferrer">http://support.microsoft.com/kb/915599</a> Resolution J. It also may be that you are not supplying a client certificate. Most likely this is an issue with TLS or SSL3 being used and the server not understanding it.</p> <p><a href="http://blogs.msdn.com/b/jpsanders/archive/2009/01/07/you-receive-one-or-more-error-messages-when-you-try-to-make-an-http-request-in-an-application-that-is-built-on-the-net-framework-2-0.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/b/jpsanders/archive/2009/01/07/you-receive-one-or-more-error-messages-when-you-try-to-make-an-http-request-in-an-application-that-is-built-on-the-net-framework-2-0.aspx</a></p> <p>And here is a list of all the other resources I've tried reading and implimenting their solutions:</p> <p><strong>Various Links I've Tried:</strong></p> <p><a href="http://support.microsoft.com/kb/901183" rel="nofollow noreferrer">http://support.microsoft.com/kb/901183</a></p> <p><a href="https://stackoverflow.com/questions/1600743/could-not-create-ssl-tls-secure-channel-could-the-problem-be-a-proxy-server">Could not create SSL/TLS secure channel - Could the problem be a proxy server?</a></p> <p><a href="https://stackoverflow.com/questions/5353771/the-request-was-aborted-could-not-create-ssl-tls-secure-channel">The request was aborted: Could not create SSL/TLS secure channel</a></p> <p><a href="https://stackoverflow.com/questions/8692532/the-request-was-aborted-could-not-create-ssl-tls-secure-channel-decrypt-retur">The request was aborted: Could not create SSL/TLS secure channel - Decrypt returned SEC_I_RENEGOTIATE</a></p> <p><a href="http://social.msdn.microsoft.com/forums/en-US/netfxnetcom/thread/99d49286-5c3a-4311-a1e3-499f035ce979/" rel="nofollow noreferrer">http://social.msdn.microsoft.com/forums/en-US/netfxnetcom/thread/99d49286-5c3a-4311-a1e3-499f035ce979/</a></p> <p><a href="http://blogs.msdn.com/b/jpsanders/archive/2009/01/07/you-receive-one-or-more-error-messages-when-you-try-to-make-an-http-request-in-an-application-that-is-built-on-the-net-framework-2-0.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/b/jpsanders/archive/2009/01/07/you-receive-one-or-more-error-messages-when-you-try-to-make-an-http-request-in-an-application-that-is-built-on-the-net-framework-2-0.aspx</a></p> <p><a href="http://forums.iis.net/t/1156690.aspx" rel="nofollow noreferrer">http://forums.iis.net/t/1156690.aspx</a></p> <p><strong>I have tried the following solutions:</strong></p> <ol> <li>Reinstall the certificate, and placed it into various stores (Personal, LocalComputer)</li> <li><p>Added this ServiceManager code:</p> <pre><code>ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3; </code></pre></li> <li><p>Enabled logging to gain more verbose details</p></li> <li>Various other solutions listed in the above links</li> </ol> <p>What is so frustrating is that this was working fine a few months ago, and now I receive this error. At first, I thought the cert expired, but it appears to be fine.</p> <p>It could be a Service Pack or Hotfix for Windows Server has created a new setting or scenario which breaks SSL. I figured that re-installing the cert would solve that. </p> <p>It is important to note that when I reinstalled, I simply added it to the various stores (Double Click the cert and install). I did not create a "Certificate Request". Since its already installed and bound to the SSL Port of my IIS Application, it should be ok.</p> <p><strong>This is the code that creates the web request:</strong> </p> <pre><code> public static Hashtable DoWebReq(string strNVP, string strNVPSandboxServer) { ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3; string _strNVP = strNVP; //Create web request and web response objects, make sure you using the correct server (sandbox/live) var wrWebRequest = (HttpWebRequest)WebRequest.Create(strNVPSandboxServer); wrWebRequest.Method = "POST"; // POST var requestWriter = new StreamWriter(wrWebRequest.GetRequestStream()); requestWriter.Write(_strNVP); requestWriter.Close(); // Get the response. var hwrWebResponse = (HttpWebResponse)wrWebRequest.GetResponse(); var responseReader = new StreamReader(wrWebRequest.GetResponse().GetResponseStream()); //and read the response string responseData = responseReader.ReadToEnd(); responseReader.Close(); string result = System.Web.HttpContext.Current.Server.UrlDecode(responseData); string[] arrResult = result.Split('&amp;'); Hashtable htResponse = new Hashtable(); string[] responseItemArray; foreach (string responseItem in arrResult) { responseItemArray = responseItem.Split('='); htResponse.Add(responseItemArray[0], responseItemArray[1]); } return htResponse; } </code></pre> <p><strong>Here are a collection of screen shots to show the various components of the SSL Machine:</strong></p> <p>This is the SSL Binding Settings in IIS: <img src="https://i.stack.imgur.com/6f1ER.jpg" alt="SSL Bindings"></p> <p>Here is an overview of the installed Certs: <img src="https://i.stack.imgur.com/9NSBx.jpg" alt="certs1"></p> <p>This is the Error I receive: <img src="https://i.stack.imgur.com/qupnX.jpg" alt="SSL Error"></p> <p><img src="https://i.stack.imgur.com/KYAQ4.jpg" alt="certs2"></p> <p>Certs Installed: <img src="https://i.stack.imgur.com/P8TOA.jpg" alt="enter image description here"></p> <p>Certificate Details <img src="https://i.stack.imgur.com/SMaZ8.jpg" alt="enter image description here"></p> <p>Any advice on fixing this error would be most appreciated. Some possibilities I've considered but not addressed are:</p> <ol> <li>Could the request be taking too long? It seems fast enough... but I've read this could be a problem.</li> <li>In Internet Explorer, I do see the Green "SSL Bar" which shows this site is verified as being secure. This tells me the Cert is installed correctly, is this true?</li> <li>Is there a simple test I can perform with a HTTP request of some kind to help narrow down the source of the problem?</li> <li>Could this have anything to do with PayPal? Is it possible paypal is rejecting the request due to credentials on their end? </li> <li>Would implementing an <a href="https://msdn.microsoft.com/en-us/library/k8z4ffe4%28vs.71%29.aspx" rel="nofollow noreferrer">ICertificatePolicy Interface</a> be of any help in debugging the issue? I'm hoping I can just fix it.</li> </ol> <p>I would think that either the SSL would work or not, it has no bearing/dependency on PayPal at all... but I could be wrong.</p> <p>I feel like I should be able to just use the Name Value Pair URL which is built by the WebClient class, and send that over the pipe via IE and receive a response.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload