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

后端 未结 30 1850
遇见更好的自我
遇见更好的自我 2020-11-22 01:21

We are unable to connect to an HTTPS server using WebRequest because of this error message:

The request was aborted: Could not create SSL/TLS secur

30条回答
  •  星月不相逢
    2020-11-22 02:03

    I finally found the answer (I haven't noted my source but it was from a search);

    While the code works in Windows XP, in Windows 7, you must add this at the beginning:

    // using System.Net;
    ServicePointManager.Expect100Continue = true;
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
    // Use SecurityProtocolType.Ssl3 if needed for compatibility reasons
    

    And now, it works perfectly.


    ADDENDUM

    As mentioned by Robin French; if you are getting this problem while configuring PayPal, please note that they won't support SSL3 starting by December, 3rd 2018. You'll need to use TLS. Here's Paypal page about it.

提交回复
热议问题