setExpressCheckout and SSL/TLS error

前端 未结 4 1689
暗喜
暗喜 2021-02-14 02:35

I\'m trying to develop a simple application that will enable users to purchase services off a website through the Paypal API. This application is running on ASP.NET with C#.

4条回答
  •  [愿得一人]
    2021-02-14 03:18

    Since early 2016, Paypal started requiring TLS 1.2 protocol for communications in the Sandbox, and will enforce it for the live environment starting June 17. See here for reference.

    In most .NET applications TLS 1.2 will come disabled by default, and therefore you'll need to enable it.

    You need to add the following line, for example, at the beginning of you Application_Start method:

    public class Site : HttpApplication
    {
        protected void Application_Start()
        {
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            // other configuration
        }
    }
    

提交回复
热议问题