The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Problem using MS XMLHTTPRequest via https

Hi,

I have a problem using XMLHTTPRequest (from MSXML) to access URL via "https".

I specified URL as "https://url-to-get" and assumed that XMLHTTPRequest should take care of secure connection. Probably, this is not enough, since I get exception every time I send a request.

Do I need to install an additional libraries in order to use XMLHTTPRequest via "https"?

Has anybody experienced such problem?

Thanks in advance.
ISK
Saturday, July 29, 2006
 
 
The XMLHTTP object internally relies upon the Internet Explorer API and should be capable of making SSL connections.  However, my limited experience with this has been that if using the COM object from a VBScript, certain warning dialogs that are raised from IE will cause your application to suspend until you click thru the dialog, which IMHO makes for a  terrible user experience  So if you are running your application without a user interface, say as an NT Service or other non-visible process, you will have problems.

It would be helpful to know exactly what type of exception you are receving along with the code that is giving you the problem.
Rich
Sunday, July 30, 2006
 
 
Rich, thanks for your responce.

I'm calling XMLHTTP COM object from a standalone application written in C++.

The error occurs when I call a send() method of IXMLHTTPRequest. It returns 0x800c0005 error code. I searched the Web and found that this error is:
0x800c0005 = Error 5 = Access Denied.

But I could not find what could cause it and how to avoid it.
ISK
Sunday, July 30, 2006
 
 
I wonder if that error code might be a general HRESULT with an error severity that the send() method is throwing, and not necessarily the Win32 API error 5 (Access denied). I'm not a C++ expert, but I would catch the exception and then examine the contents of the status, statusText and responseText properties. Of course that's assuming that it actually made it that far. This will allow you to see the actualy HTTP respone info which hopefully will then point out what's really going on. (Maybe a HTTP 401 or 500 is being returned from the server)

This may have nothing to do with your issue, but the other thing worth mentioning is that if this particular site is requiring two-way SSL with an installed certificate on the client side you will need to use the WinHTTPRequest COM object instead of XMLHttpReqest:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winhttp/http/winhttprequest.asp

WinHTTPRequest has similar open() and send() methods but also allows for specifying the path to a client certificate issued from a certificate authority and registered on the local machine.
Rich
Sunday, July 30, 2006
 
 
Rich, thanks for your suggestions.
I will give a try.
ISK Send private email
Monday, July 31, 2006
 
 
Is this MSXML 3.0?

If so, see
http://support.microsoft.com/kb/302080/EN-US/

If MSXML 4.0 SP2, see
http://support.microsoft.com/default.aspx?scid=kb;EN-US;820882

Look for "Security Is Tightened When You Post Data by Using the ServerXmlHttp Object"
MBJ Send private email
Monday, July 31, 2006
 
 
I use MSXML 6.0 (I did not mention it earlier, but probably should've mentioned).

I don't use ServerXmlHttp object, but XMLHTTPRequest.

send() method of XMLHTTPRequest COM object calls raw_send() method, which fails with HRESULT 0x800c0005. Then it throws _com_error exception. I caught this exception and checked the description, but it was empty.

I also ran 'netstat' command to see if application connects to the server. It showed that application connected to the web server using 'https'. Connection state was SYN_SENT.
ISK
Monday, July 31, 2006
 
 
The problem is resolved.

In the beginning I thought that the problem could be in my application, since I've never used any of XMLHTTP related APIs before.

When I gave up looking for the problem, I contacted IT department at that site and they found the problem with their server. They fixed the problem and now everything is working as expected.

Thank you all for your help.
ISK Send private email
Thursday, August 03, 2006
 
 
I think I am having this same issue.  Can you tell me what the IT dept did to solve this issue?

Thanks,
JNM
Julie McKenzie Send private email
Tuesday, August 22, 2006
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz