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
With Net 4.6 there is HttpClient and WinHttpHandler nuget package available for windows (from microsoft) to set SslProtocols parameters. With Net core you can use HttpClientHandler class for the same.
using (var hc = new HttpClient(new WinHttpHandler() // should have it as a static member
{
AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip,
SslProtocols = SslProtocols.Tls |
SslProtocols.Tls11 |
SslProtocols.Tls12
}))
{
var r = hc.SendAsync(new HttpRequestMessage(HttpMethod.Get, "https://..."));
r.Wait();
Console.WriteLine(r.Result.StatusCode);
} // using