搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

Learn More

Is there way to check via javascript if my self-signed certificate is installed in my browser

  • 1 个回答
  • 3 人有此问题
  • 313 次查看
  • 最后回复者为 dveditz

more options

At the company where I work we chose to create a self-signed certificate and try to install it on all browsers. It was possible to place it in Internet Explorer and Google Chrome but fail in Firefox. We create a page similar to this (http://br.mozdev.org/firefox/caixa) and would like to display it if the browser does not have the public key installed. Is there a way to check via javascript whether a certificate is installed in the browser?

At the company where I work we chose to create a self-signed certificate and try to install it on all browsers. It was possible to place it in Internet Explorer and Google Chrome but fail in Firefox. We create a page similar to this (http://br.mozdev.org/firefox/caixa) and would like to display it if the browser does not have the public key installed. Is there a way to check via javascript whether a certificate is installed in the browser?

所有回复 (1)

more options

There's no simple JavaScript "is this installed" method, but you might be able to detect it through fingerprinting tricks.

  1. host an image on a site whose cert is issued by the root you want to detect.
  2. write a function redirectToCertPage()
  3. on the page you wanted to check from add
   <img src="https://the_site/the_image" onerror="redirectToCertPage()">

If the onerror fires the user most likely doesn't have the certificate installed. There might be less likely reasons the user can't reach the image (machine down, someone moved the image file) but it should do.

由dveditz于修改