Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

搜索 | 用户支持

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

Learn More

How to include a client side certificate (for server authentication) into Firefox profile through command line?

  • 1 个回答
  • 2 人有此问题
  • 12 次查看
  • 最后回复者为 cor-el

more options

I'm automating the use-cases for a web based application, for which the client and server has to authenticate using a signed certificate (by Internationally recognized authorities). As this is a test environment, this is neither a CA signed certificate at server nor at client side. So I'm using self signed certificates, and using them. So when I access the web application, browser first throws 'untrusted certificate error' for which I handled using below snippet - .... ProfilesIni allProfiles = new ProfilesIni(); if (isHTTPS) { System.setProperty("webdriver.firefox.profile", "default"); String browserProfile = System.getProperty("webdriver.firefox.profile"); FirefoxProfile profile = allProfiles.getProfile(browserProfile); profile.setAcceptUntrustedCertificates(true); } driver = new FirefoxDriver(); selenium = new WebDriverBackedSelenium(driver, url); selenium.setTimeout("300000"); selenium.open(uri); ...

Now to authenticate the server request from the client side, I need to respond with an appropriate client side certificate, which server can understand and respect the client request.

How to handle this scenario pragmatically?

Also not that I need to have different client certificates for each of test case scenarios, so I need to prepare the Firefox profile dynamically for each of the test cases by modifying the existing Firefox profile, i.e., I need to remove the certificate at the end of the test case and include the newly created client certificate. How can I accomplish this?

I'm automating the use-cases for a web based application, for which the client and server has to authenticate using a signed certificate (by Internationally recognized authorities). As this is a test environment, this is neither a CA signed certificate at server nor at client side. So I'm using self signed certificates, and using them. So when I access the web application, browser first throws 'untrusted certificate error' for which I handled using below snippet - .... ProfilesIni allProfiles = new ProfilesIni(); if (isHTTPS) { System.setProperty("webdriver.firefox.profile", "default"); String browserProfile = System.getProperty("webdriver.firefox.profile"); FirefoxProfile profile = allProfiles.getProfile(browserProfile); profile.setAcceptUntrustedCertificates(true); } driver = new FirefoxDriver(); selenium = new WebDriverBackedSelenium(driver, url); selenium.setTimeout("300000"); selenium.open(uri); ... Now to authenticate the server request from the client side, I need to respond with an appropriate client side certificate, which server can understand and respect the client request. How to handle this scenario pragmatically? Also not that I need to have different client certificates for each of test case scenarios, so I need to prepare the Firefox profile dynamically for each of the test cases by modifying the existing Firefox profile, i.e., I need to remove the certificate at the end of the test case and include the newly created client certificate. How can I accomplish this?

所有回复 (1)

more options

You would need to build the certutil tool to manipulate the cer8.db file.