TLS 1.2 not negotiated in .NET 4.7 without explicit ServicePointManager.SecurityProtocol call

后端 未结 5 1513
长情又很酷
长情又很酷 2020-12-04 15:51

I need to upgrade a .NET application to support a call to an API on a website that only supports TLS 1.2. From what I read, if the application is targeting 4.6 or higher the

5条回答
  •  庸人自扰
    2020-12-04 16:04

    I've found one solution. It doesn't answer the question about why TLS 1.2 isn't being used by default on Win10 with .NET 4.7, but it does allow me not to have to set ServicePointManager.SecurityProtocol.

    The solution that worked from both my 4.5.2 and 4.7 test apps is to add the following to app.config:

    
    

    Here the whole app.config:

    
    
         
            
        
        
          
        
    
    

提交回复
热议问题