最佳做法现在建议禁用SSL V3.0。它还建议禁用RC4和除GRC密码以外的所有密码,因为它们都容易受到攻击。
但是,如果您设置Windows Server(和IIS)以禁用SSL V3.0以及除GRC密码以外的所有密码,则使用HttpClient进行连接的所有.net客户端都会失败,说明不支持兼容协议。
我已将其设置为使用TLS,但仍然没有,我无法弄清楚如何告诉它使用GRC密码。
任何人都有办法解决如何在.NET 4.5客户端中启用TLS 1.2和GRC以便它连接到配置为最佳实践的服务器(并被PCI推动?)
(而且,Microsoft,您需要发布.NET补丁,这是默认行为!)
答案 0 :(得分:1)
您是否尝试添加安全协议
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
例如:
using (var client = new HttpClient())
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
client.BaseAddress = new Uri("https://www.myurl.com");
var response = client.PostAsync("api/Values", model, new JsonMediaTypeFormatter()).Result;
}