Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The request was aborted: Could not create SSL/TLS secure channel sandbox account

It was working well before a week but now it shows following error. I have tried the following things but of no use.

ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3; 

so suggest me with possible solution

public string HttpCall(string NvpRequest) //CallNvpServer     {         string url = pendpointurl;          //To Add the credentials from the profile         string strPost = NvpRequest + "&" + buildCredentialsNVPString();         strPost = strPost + "&BUTTONSOURCE=" + HttpUtility.UrlEncode(BNCode);          ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;         // allows for validation of SSL conversations         ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };           HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url);         objRequest.Timeout = Timeout;         objRequest.Method = "POST";         objRequest.ContentLength = strPost.Length;          try         {             using (StreamWriter myWriter = new StreamWriter(objRequest.GetRequestStream()))             {                 myWriter.Write(strPost);             }         }         catch (Exception e)         {             /*             if (log.IsFatalEnabled)             {                 log.Fatal(e.Message, this);             }*/         }          //Retrieve the Response returned from the NVP API call to PayPal         HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();         string result;         using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()))         {             result = sr.ReadToEnd();         }          //Logging the response of the transaction         /* if (log.IsInfoEnabled)          {              log.Info("Result :" +                        " Elapsed Time : " + (DateTime.Now - startDate).Milliseconds + " ms" +                       result);          }          */         return result;     } 
like image 880
vellai durai Avatar asked Jan 22 '16 05:01

vellai durai


People also ask

Was aborted Could not create SSL TLS secure channel?

The error “The request was aborted: Could not create SSL/TLS secure channel.” can happen during any download HTTP request. This error generally will correspond to firewalls, proxies or DNS filtering blocking the connection or an SSL/TLS cipher misconfiguration.

Could not create SSL TLS secure channel certificate?

However, the "Could not create SSL/TLS secure channel" error usually means that there's something wrong with the server certificate, e.g. the certificate is for a different hostname, or otherwise invalid, or not trusted etc.

Can't create SSL TLS secure channel excel?

Steps to Reproduce:Open the Microsoft Excel and check the version using Account ( In this case I was testing with Microsoft Excel 2016) Open the Microsoft Excel --> Data --> From Other Source --> From Odata Data Feed. Fill in the connection which can be found from Step 2. Below error is shown.

What is SSL TLS secure channel?

SSL/TLS creates a secure channel between a users' computer and other devices as they exchange information over the internet, using three main concepts: encryption, authentication, and integrity to accomplish this. Encryption hides data being transferred from any third parties.


1 Answers

I just ran into this same problem in my testing environment as well (luckily my live payments are going through). I fixed it by changing:

public PayPalAPI(string specialAccount = "") {     System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls; 

to

public PayPalAPI(string specialAccount = "") {     System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12; 

They disabled support for SSL3 a while ago: https://www.paypal.com/uk/webapps/mpp/ssl-security-update, specifically stating

Ensure you are connecting to PayPal endpoints using TLS 1.0 or 1.2 (not all API endpoints currently support TLS 1.1).

Their latest update (thx for the comment update from @awesome) states:

PayPal is updating its services to require TLS 1.2 for all HTTPS connections. At this time, PayPal will also require HTTP/1.1 for all connections... To avoid any disruption of service, you must verify that your systems are ready for this change by June 17, 2016

like image 146
MikeSmithDev Avatar answered Oct 05 '22 11:10

MikeSmithDev