Have serverxmlhttp ignore request for option client-certificate
A certain SOAP webserver I want to reach is configured to 'Accept client certificates' but does not require them!
When I enter the URL directly into Internet Explorer it will show a pop up for a client certificate (which I do not have). When I cancel this dialog a second dialog pops up for a username and password. This work fine with my username and password.
I am trying to do the same from within a script using ServerXMLHTTP
var objXMLHTTP = new ActiveXObject("MSXML2.ServerXMLHTTP.6.0") // or 4.0
objXMLHTTP.open("POST",
"https://www.example.com",
false,
"username",
"password");
objXMLHTTP.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
开发者_如何学Python// objXMLHTTP.setOption(2) = 13056; // This does not help
objXMLHTTP.send(XMLReq); // This fails
The error message is msxml6.dll: An unknown error occurred while processing the certificate.
or msxml6.dll: A connection with the server could not be established
How can I get ServerXMLHTTP to ignore the optional(!) request for the client-certificate and proceed with the basic authentication? Or what other component can I use?
Notes:
- I cannot change settings on the webserver or get a client-certificate.
- I also tried WinHTTP.WINHTTPRequest.5.1 but that did not help.
- Remember: this question is about client certificates.
objXMLHTTP.setOption(2) = 13056
will only ignore server certificate errors.
To keep you updated and for future reference: i gave up.
As far as I came to understand, it can be done using the more lowlevel win32 WinHTTP API. My guess: I need to so something with the setting WINHTTP_OPTION_CLIENT_CERT_CONTEXT from http://msdn.microsoft.com/en-us/library/aa384066%28VS.85%29.aspx but the serverxmlhttp API is to limited to support it.
In the end I was able to create a client certificate and have it trusted by the SOAP-server
精彩评论