C# 指定http請求使用Tls1.2

轉載於php

https://blog.csdn.net/yanghaitian/article/details/77498872c#

 

客戶端語言
版本
類庫
是否支持
兼容方案
 
Java 1.6.115以前   第三方支持包  
  1.6.115以後   啓動jvm 添加參數-Dhttps.protocols=TLSv1.1,TLSv1.2   
  1.7   啓動jvm 添加參數-Dhttps.protocols=TLSv1.1,TLSv1.2   
  1.8   默認支持  
Nodejs 各個版本   默認支持  
c#,asp.net 4.0-4.4  

在發送HTTP請求前加入下行代碼asp.net

ServicePointManager.SecurityProtocol = (SecurityProtocolType)192 | (SecurityProtocolType)768 | (SecurityProtocolType)3072;
 
  4.5  

若是是4.5以上版本能夠直接使用curl

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;
 
Python  2.7-3   默認支持  
curl 7.19.7   默認支持  
Golang  1.7.4 net/http 默認支持  
Ruby          
php php5.6 file_get_contents    
    http\client    
    curl    
  php5.3.29 file_get_contents    
    http\client    
    curl
相關文章
相關標籤/搜索