【发布时间】:2011-07-20 07:15:15
【问题描述】:
所以,我有以下系统:有一个客户端应用程序,它请求服务如下:
blar.ServiceSecurity wsSecurity = new blar.ServiceSecurity();
wsSecurity.Url = this.tURL + "Security.asmx";
CookieContainer cc = new CookieContainer();
wsSecurity.CookieContainer = cc;
wsSecurity.ClientCertificates.Add(X509Certificate.CreateFromCertFile(certPath));
blar.LoginResult lr = wsSecurity.Login(login, password);
然后,this.tURL + "Security.asmx" 的 Login 方法中的网络服务必须从以下位置获取 ClientCertificate (certPath):
Context.Request.ClientCertificate.Certificate;
然后用它做点什么。
有两个问题:
如果 IIS 的配置显示 Require client certificates,我在调用登录函数时收到 403.7 错误;
如果 IIS 的配置显示 Accept client certificates,我得到 CryptographicException "m_safeCertContext is an invalid handle";
但是,只有当客户端在 Windows 7 x64 上运行时才会出现这些问题,当在 Windows XP 或 Windows Server 2003 上启动时,它运行良好。
ca 安装在两台机器上,所有测试用例的配置似乎完全相同,
所以我的问题是'这到底是什么?'
【问题讨论】:
-
您也可以在 Vista / Windows 7 x86 上进行测试吗? XP / 2003 之后证书 API 发生了巨大变化;在 Vista / 7 x86 上进行测试可以帮助确定它是 64 位问题还是其他问题。
标签: web-services .net-3.5 x509certificate windows-7-x64 client-certificates