我在 Windows 7 中安装了三个客户端证书,需要使用一个特定的证书来验证使用 VBA 的 ServerXMLHTTP60 调用。
使用证书的友好名称调用 ServerXMLHTTP60.SetOption 不会出错。但是随后的 .send 失败并显示“需要证书才能完成客户端身份验证”。
代码示例:
Public Sub TestCert()
Dim myHTTP as New ServerXMLHTTP60
Dim myURL as String
' Open the connection to the secure server
myHTTP.Open "GET", "https://server/finalpath", False
' Attempt to set the correct client certificate
' I have also tried just the friendly name as well as
' LOCAL_MACHINE\My\cert friendly name'
myHTTP.SetOption 3, "CURRENT_USER\My\cert friendly name"
' Send request fails with "A certificate is required ..."
myHTTP.Send
End Sub
指定的证书可以通过 IE 或 Firefox 与此站点正常工作。我必须为证书使用不正确的路径名。有没有办法确定正确的客户端证书路径名以确保成功?