0

I'm using a XMLHTTPRequest object in my C++ project. I have things working fine with normal http requests and https requests on servers with valid certificates. When I attempt to make an https:// request to a server who's certificate would produce an IE "There is a problem with this website's security certificate." error if I tried to browse there with IE, the request fails.

The result I get back from the request is a 12019 error. Is there any way to make the request ignore the error and continue on as if a user had clicked on the "continue to this website" link.

You are going to suggest I fix whatever is wrong with the certificate. At the moment I don't have control of that certificate, so I'm looking for an answer (if there is one) that does not include correcting the certificate.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Dan G
  • 836
  • 11
  • 31
  • The ServerXMLHTTP object has a setOption(SXH_OPTION_SELECT_CLIENT_SSL_CERT, 13056) function that I see allows me to ignore the error successfully. Unfortunately, the Server specific nature of this object seems to be killing functionality that I need from XMLHttpRequest. Can't retrieve cookies created by a previous ServerXMLHTTP. That's vital to what I need to do. – Dan G Aug 12 '09 at 15:46

2 Answers2

1

There is a way, but not with XMLHTTPRequest. When using WinHTTP, you can use:

DWORD dwOptions = 
    SECURITY_FLAG_IGNORE_CERT_CN_INVALID 
    | SECURITY_FLAG_IGNORE_CERT_DATE_INVALID 
    | SECURITY_FLAG_IGNORE_UNKNOWN_CA 
    | SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE; 

bResults = WinHttpSetOption( hRequest,
    WINHTTP_OPTION_SECURITY_FLAGS,
    &dwOptions,
    sizeof(dwOptions));
Jason Plank
  • 2,336
  • 5
  • 31
  • 40
Chizl
  • 11
  • 1
0

just have bug with ajax response status=12019 if IE6 and i found that request URL contains double slash! http://site//get/param1/param2 [censored]!...... :)

so if somebody still have same problem -- try ti check request URL for double slashes

12019 -- it's very strange... but very "by microsoft"