0

我正在使用这种方法登录到 betfair api。一切正常,但在 Windows 10 更新 (KB3140741) 之后不再工作。ResponseText = {"loginStatus":"CERT_AUTH_REQUIRED"} 有人解决了吗?

Windows 10 内部版本 10586.218,版本 1511 Microsoft Office 2016

Dim oHTTP As Object: Set oHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
Dim uri As String: uri = "https://identitysso.betfair.com/api/certlogin"
oHTTP.Open "POST", uri, False
oHTTP.SetClientCertificate "Common Name"
oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oHTTP.setRequestHeader "X-Application", App_key
oHTTP.setRequestHeader "Accept", "application/json"
oHTTP.send "username=" & UserName & "&password=" & Password & "" 
4

1 回答 1

0

我会尝试使用Msxml2.ServerXMLHTTP.6.0

Const uri = "https://identitysso.betfair.com/api/certlogin"

Dim req As Object
Set req = CreateObject("Msxml2.ServerXMLHTTP.6.0")

req.Open "POST", uri, False
req.setOption 2, 13056          ' ignore all certificate errors '
req.setOption 3, "Common Name"  ' set the client certificate from the local store '
req.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
req.setRequestHeader "X-Application", App_key
req.setRequestHeader "Accept", "application/json"
req.send "username=" & UserName & "&password=" & Password & ""
于 2016-04-29T10:27:16.887 回答