由于我刚刚发现RFC 5425需要使用TLS 1.2,并且.NET还不支持它,我想知道是否有任何实现,可能是开源的TLS 1.2协议,如RFC 5246中所定义.
谢谢.
我有一个应用程序使用HTTPS POST将数据发送到服务器.我使用System.Net.WebClient对象来执行此操作.这是一个发送一些数据的函数:
private byte[] PostNameValuePairs(string uri, NameValueCollection pairs)
{
byte[] response;
String responsestring = "";
using (WebClient client = new WebClient())
{
client.Headers = GetAuthenticationHeader();
string DataSent = GetNameValueCollectionValuesString(pairs);
try
{
response = client.UploadValues(uri, pairs);
responsestring = Encoding.ASCII.GetString(response);
}
catch (Exception e)
{
responsestring = "CONNECTION ERROR: " + e.Message;
return Encoding.ASCII.GetBytes(responsestring);
}
finally
{
_communicationLogger.LogCommunication(uri, client.Headers.ToString(), DataSent, responsestring);
}
}
return response;
}
Run Code Online (Sandbox Code Playgroud)
我们传入一个以https://开头的URI
这已经很长时间了.今天,我们开始收到以下连接错误:"基础连接已关闭:发送时发生意外错误".我们对服务器的所有者进行了一些故障排除,他们最终将其缩小到以下内容.他们对服务器进行了更改以阻止TLS 1.0,并表示我们现在需要使用TLS 1.1或1.2发送数据.
我需要在我的WebClient对象(或我的函数中的其他位置)中设置什么才能使用TLS 1.1或1.2而不是TLS 1.0?
我们正在使用.NET Framework 4.5,如果这有所作为.
My question is simple, I have read these two main pages :
But from the first link, it's showing configuration for SecurityProtocol set in global.asax.cs for solving
"System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel."
Here, I want this config is set in web.config / app.config, just for making it a little specific for own project not for all asp.net projects... Then I …