Can we determine if the root certificate of the CA is installed?

Is this possible with JavaScript or PHP? I want to find out if my private CA is installed on the iOS or Android user device. From there, I can decide whether to provide installation instructions or not. I was "googlin" and did not find anything useful. Has anyone tried this before? I want to know what I should spend on training. If this is not possible, can you suggest an alternative in the browser?

EDIT: I have no choice here, and this is not my decision. Private CA certificate will be used for other security reasons.

+4
source share
2 answers

I doubt that there will be any device request to verify this.

I actually did not do this, but you could probably come up with a test in which JavaScript makes an AJAX request to an https server that uses the certificate that you want to verify. If the request succeeds, then the certificate works. ( This question seems to imply that AJAX requests (correctly) will fail if the SSL certificate does not validate)

Please note that since the URL scheme (http or https) will be different (and the domain may depend on how you set it up), your test site will have to use the CORS Access-Control-Allow-Origin header so that the browser can fulfill the request. See: AJAX causes unreliable (self-signed) HTTPS failure without response

EDIT: I had time and put together a very simple example. Go to http://ssl_test.gjp.cc . This page will try to make an AJAX request https://ssl_test2.gjp.cc , which uses a self-signed certificate. Before you trust ssl_test2 , you will see “Failure” on the ssl_test page, however, as soon as you trust the certificate for ssl_test2 , you should always see “Success” on ssl_test .

Please note that this does not prove that your user has a CA certificate - all this proves that they configured their browser to trust the test site ( ssl_test2 ). If you never point the user to a test site, they will never have the opportunity to trust only that site, so this should work quite well.

+6
source

Maybe this will help:

 <img src="https://the_site/the_image" onerror="redirectToCertPage()" /> 
+1
source

Source: https://habr.com/ru/post/1499213/


All Articles