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

前端 未结 9 1228
执笔经年
执笔经年 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:26

    You can achieve this by this code to close all underlying connections and force a new handshake.

    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
    ...
    ...
    ...
    request.ServicePoint.CloseConnectionGroup(request.ConnectionGroupName);
    

提交回复
热议问题