& Quot; Request aborted: failed to create SSL/TLS secure channel & quot; solution: ssltls

Source: Internet
Author: User

"Request aborted: failed to create SSL/TLS Secure Channel" solution, ssltls

1. Install the certificate:

Manual double-click certificate Installation

2. Assign permissions:

Find the Installed Certificate on the console, right-click it, and choose manage private key ",

 

Add the required permissions. If you want to test, you can directly add Everyone.

3. modify the code: public static string Refund (string urlWithParams)

{ServicePointManager. expect100Continue = true; ServicePointManager. securityProtocol = SecurityProtocolType. tls; // select the Protocol as needed. If not, try ServicePointManager again. response = (object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) ==>{ return true ;}; HttpWebRequest webRequest = (HttpWebRequest) HttpWebRequest. create (urlWithParams); webRequest. method = "GET"; // find the imported certificate X509Store certStore = new X509Store (StoreName. my, StoreLocation. localMachine); certStore. open (OpenFlags. readOnly); X509Certificate2Collection certCollection = certStore. certificates. find (X509FindType. findBySubjectName, "Certificate Name installed", false); webRequest. clientCertificates. add (certCollection [0]); using (WebResponse webResponse = webRequest. getResponse () {var sr = new StreamReader (webResponse. getResponseStream (), Encoding. UTF8); var responseData = sr. readToEnd ();
Return responseData ;}}

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.