Set the SecurityProtocol (Ssl3 or TLS) on the .net HttpWebRequest per request

前端 未结 9 1254
执笔经年
执笔经年 2020-11-28 07:10

My application (.net 3.5 sp1) uses the HttpWebRequest to communicate with different endpoints, sometimes its over HTTPS where each hosting server may have a different securi

9条回答
  •  一个人的身影
    2020-11-28 07:35

    After some of our vendors stopped support for ssl3 while other use it exclusively, many issues appear in our system that could be resolved with functionality from this question. But six years after, we still don't have built in mechanism to achieve this. Our workaround is to explicitly define security protocol that will support all scenarios, like this:

        System.Net.ServicePointManager.SecurityProtocol = 
        System.Net.SecurityProtocolType.Ssl3 
        | System.Net.SecurityProtocolType.Tls12 
        | SecurityProtocolType.Tls11 
        | SecurityProtocolType.Tls;
    

提交回复
热议问题