Is that possible to send HttpWebRequest using TLS1.2 on .NET 4.0 framework

后端 未结 6 1864
长发绾君心
长发绾君心 2020-11-30 06:27

My application connects to Experian server and Experian will soon stop supporting TLS 1.0 and TLS 1.1. All connectivity using HTTPS must use TLS Version 1.2.

I want

6条回答
  •  一生所求
    2020-11-30 07:08

    I had to deal with the same problem, while integrating PayPal into a legacy application, and found the following workaround for .NET 4.0 which seems to do the trick:

    ServicePointManager.Expect100Continue = true;
    ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
    ServicePointManager.DefaultConnectionLimit = 9999;
    

    Basically the workaround is to directly assign the port for TLS 1.2.

    All credit goes to the commenter at CodeProject.

提交回复
热议问题