2778
2778

Reputation: 864

AJAX accessing untrusted HTTPS fails without 'do you want to proceed' prompt

I was pulling my hair over this until I browsed manually to the HTTPS server and saw the prompt

The site's security certificate is not trusted!
Proceed anyway / Back to safety

Apparently when AJAX was trying to access this page and it ran into this prompt and it would just automatically decide the connection should be rejected. Is there a way to propagate a prompt to the client? Or have AJAX choose 'proceed anyway' and ignore the warning?

P.S. I have access to the .crt's as well, but I've tried importing them into chrome's certificate stores and despite saying 'import successful' they never show up in the store...

Upvotes: 1

Views: 1104

Answers (1)

Steffen Ullrich
Steffen Ullrich

Reputation: 123471

First, it is a bad idea to access a https site with a bad certificate which results in a warning and expect the user to just accept the bad certificate. But, if this only for testing you need to direct the user first to page on the https server directly (without Ajax, iframe etc), and once the user accepted the certificate you can can continue with the ajax requests to the same host.

Upvotes: 2

Related Questions