msxml3.dll错误'80072f0c'需要证书才能完成客户端身份验证 [英] msxml3.dll error '80072f0c' A certificate is required to complete client authentication

查看:300
本文介绍了msxml3.dll错误'80072f0c'需要证书才能完成客户端身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了paypal api证书,并使用winhttpcertcfg授予了对正确身份的私钥访问权限.我已经用尽了在各个论坛上找到的所有已知修补程序",并继续收到此错误.我正在运行最新的msxml版本.

I've installed the paypal api certificate and given private key access to the proper identities using winhttpcertcfg. I've exhausted all of the "known fixes" found on various forums and continue to get this error. I'm running the lastest msxml versions.

使用贝宝(Paypal)代码示例出现错误

Using the paypal code example I get the error

msxml3.dll错误'80072f0c' 需要证书才能完成客户端身份验证

msxml3.dll error '80072f0c' A certificate is required to complete client authentication

无论使用3.0、4.0还是6.0版本的MSXML2.ServerXMLHTTP,该错误都是恒定的,尝试使用REST Api时会收到相同的错误.

The error is constant whether using 3.0, 4.0 or 6.0 versions of MSXML2.ServerXMLHTTP, and I receive the same error when trying to utilize the REST Api.

我正在测试连接的代码如下.

The code I am testing the connection with is as follows.

<%
Dim vrequest, strPayPalCert
Dim payPalURL, payPalUser, payPalAppID, payPalPassword, payPalClientID, payPalSecret

Const SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = 13056
Const SXH_OPTION_SELECT_CLIENT_SSL_CERT = 3

payPalURL      = "https://api.sandbox.paypal.com" 
payPalUser     = "xx_user_xx"
payPalAppID    = "APP-80W284485P519543T"
payPalPassword = "xx_password_xx"
payPalClientID = "xx_client_id_xx"
payPalSecret   = "xx_secret_xx"

Const paypal_request_format = "JSON"
Const paypal_response_format = "JSON"

strPayPalCert = "paypal_cert_name"

vrequest = vrequest & "&actionType=" & "PAY"
vrequest = vrequest & "&cancelUrl= cancelUrl.asp"
vrequest = vrequest & "&clientDetails.ipAddress=" &  Request.ServerVariables("LOCAL_ADDR") 
vrequest = vrequest & "&clientDetails.partnerName=MySite" 
vrequest = vrequest & "&currencyCode=USD" 
vrequest = vrequest & "&feesPayer=0.00"
vrequest = vrequest & "&receiverList.receiver(0).email=receiver@paypal.com" 
vrequest = vrequest & "&receiverList.receiver(0).amount=1.00" 
vrequest = vrequest & "&requestEnvelope.errorLanguage=" &  "en_US"
vrequest = vrequest & "&requestEnvelope.detailLevel=" &  "ReturnAll"
vrequest = vrequest & "&returnUrl=returnURL.asp"

If not isobject(vXMLHttp) Then
  Set vXMLHttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
End If

vXMLHttp.setOption(2) = SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS

' This throws certificate error due to space
vXMLHttp.setOption(3) = "LOCAL_MACHINE\My\ " & strPayPalCert


'This works
vXMLHttp.setOption(3) = "LOCAL_MACHINE\My\" & strPayPalCert

strURL = "https://svcs.sandbox.paypal.com/AdaptivePayments/Pay"
vXMLHttp.open "POST", strURL, false  

vXMLHttp.setRequestHeader "X-PAYPAL-SECURITY-USERID", payPalUser
vXMLHttp.setRequestHeader "X-PAYPAL-SECURITY-PASSWORD", payPalPassword
vXMLHttp.setRequestHeader "X-PAYPAL-REQUEST-DATA-FORMAT", paypal_request_format
vXMLHttp.setRequestHeader "X-PAYPAL-RESPONSE-DATA-FORMAT", paypal_response_format
vXMLHttp.setRequestHeader "X-PAYPAL-APPLICATION-ID", payPalAppID

vXMLHttp.Send vrequest
vXMLHttp.waitForResponse 5 

strResponse = vXMLHttp.responseText  

Set RegularExpressionObject = nothing
Set vXMLHttp = nothing

arrList = split(strResponse, chr(38))

For each item in arrList
   Response.Write(item & "<br />" )
Next

strTemp =  arrList(4)
arrList =  split(strTemp, chr(61))
Response.Write("<br><br>Now you need to redirect user to paypal server to complete transaction using following URL:<br>")
Response.Write("https://www.sandbox.paypal.com/webscr?cmd=_ap-payment&paykey=" &arrList(1))

%>

编辑以显示解决方案

推荐答案

证书身份验证在Classic ASP中不起作用.尝试使用外部库(例如cURL)执行HTTPS请求.

Certificate authentication doesn't work in Classic ASP. Try using an external library (like cURL) for doing HTTPS requests.

这篇关于msxml3.dll错误'80072f0c'需要证书才能完成客户端身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆