【发布时间】:2014-05-27 14:39:03
【问题描述】:
我有一个简单的 webclient 调用,我必须使用 .NET Framework 2.0 和 HTTPS。 在 Windows 7 客户端上工作并在启用了 Windows 身份验证的 Windows Server 2012 上调用 IIS 8。
using (var wb = new WebClient())
{
wb.Credentials = new NetworkCredential(username, password);
NameValueCollection data = GeneratePostData();
var res = wb.UploadValues(url, "POST", data);
string strResponse = Encoding.ASCII.GetString(res);
}
Fiddler 工作捕获和只有 401 响应的区别在于 not woking 2.0 版本中添加了 Seal (confidentiality):
Unicode supported in security buffer.
OEM strings supported in security buffer.
Request server's authentication realm included in Type2 reply.
Sign (integrity)
Seal (confidentiality)
NTLM authentication.
Negotiate Always Sign.
Negotiate NTLM2 Key.
Supports 56-bit encryption.
Supports 128-bit encryption.
Client will provide master key in Type 3 Session Key field.
在 .NET 4.5 中完美运行
我怎样才能让它在 2.0 中工作?
如果出现问题,如何去除印章(保密)?
如何在不使用 WebClient 或 HttpWebRequest ... 的情况下在 2.0 中进行完整调用?
【问题讨论】:
标签: c# https authorization .net-2.0 webclient