为什么以下代码无法成功连接到需要SHA2证书的服务器?我们的一个合作伙伴进行了SHA2升级,他们要求我们拥有SHA2证书。当我们连接到不需要SHA2证书(仅限SHA1)的站点时,它会成功连接下面的代码。当我们尝试连接到需要SHA2证书的站点(secure.anywhere.org)时,我们收到错误:服务器返回错误 - 完成此操作所需的数据尚不可用。已安装所有正确的SHA2证书。我们为SHA2安装了Root和Intermediate证书。这可能是WinHTTP的问题吗?或者这可能与我们需要修复的环境配置有关吗?
完整错误:
服务器返回错误:-2147483638 完成此操作所需的数据尚不可用。
用于连接的代码:
<%
On Error Resume Next
Response.ContentType = "text/html"
Dim xobj
Dim sPostData
Set xobj = CreateObject("WinHttp.WinHttpRequest.5.1")
If Err.Number <> 0 Then
Response.Write "<b>"
Response.Write "Error Creating XMLHTTP: " & Err.Number & "<BR>" & Err.Description
Response.Write "</b>"
Response.End
End If
If Not IsObject(xobj) Then
Response.Write "<b>"
Response.Write "xobj is not an object: " & Err.Number & "<BR>" & Err.Description
Response.Write "</b>"
Response.End
End If
qu = Request.form("SSN")
sPostData
sPostData = "user_id=abcd1234&password=67judlaufosaf&qu=" & qu
xobj.Open "POST", "https://www.anywhere.org/secure_area/test_panel.asp", False
xobj.setRequestHeader "Referer", "https://www2.homeu.nc.edu/tns/connect.asp"
xobj.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xobj.Send sPostData
response.buffer = True
response.clear
response.ContentType = xobj.getResponseHeader("Content-Type")
response.AddHeader "Content-Type", xobj.getResponseHeader("Content-Type")
response.BinaryWrite xobj.responseBody
If Err.Number <> 0 Then
Response.Write "<b>"
Response.Write "Server returned error: " & Err.Number & "<BR>" & Err.Description
Response.Write "</b>"
Set xobj = nothing
Response.End
End If
Set xobj = nothing
response.end
%>