Dan G
Dan G

Reputation: 856

XMLHttpRequest and certificate errors

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.

Upvotes: 0

Views: 3441

Answers (2)

Chizl
Chizl

Reputation: 11

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));

Upvotes: 1

Peter
Peter

Reputation:

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"

Upvotes: 0

Related Questions