Is there a way to control browser's certificate selection popup manually?

妖精的绣舞 提交于 2019-12-12 04:30:36

问题


I'd like to control certificate popup windows manually. For example, if an user wanna login with client-side-certificate, I prompts a certificate selection window; If he wanna login with username/password. System let him in without checking his certificate.


回答1:


There are no standard APIs (or non-standard that I'm aware of) for controlling this with JavaScript or something similar.

The only solution I can think of is to have two webservers.

  • One for showing a web page that links to either the login form or the client certificate, and this server also implements the login form.
  • One that requires the user to specify a client certificate.

You could solve this using the same wildcard certificate for both servers and having them on different sub-domains so that you can actually back this setup by 2 different servers (IP addresses).

You can use the same actual physical server, and do "virtual host" dispatching based on the IP, and you can use the same wildcard SSL certificate for both.

The reason you need different servers is that the prompt for an SSL client certificate is triggered at the SSL handshake level, so you can't use name based virtual hosts, you need 2 actual servers to do it.



来源:https://stackoverflow.com/questions/40619577/is-there-a-way-to-control-browsers-certificate-selection-popup-manually

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!