【问题标题】:Certificate problem 403.7证书问题 403.7
【发布时间】: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


【解决方案1】:

我没有立即发现您的代码或配置有任何问题,因此您可能会发现这些工具有助于您自己找出问题:

  1. SSL Diagnostics for IIS(或对于 IIS 7,请参阅 this
  2. .NET Network Tracing
  3. Fiddler HTTP(S) proxy debugger(如何decrypt SSL
  4. SSL tracing

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-06
    • 2011-10-18
    • 2021-10-14
    相关资源
    最近更新 更多