搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

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

  • 1 回覆
  • 2 有這個問題
  • 11 次檢視
  • 最近回覆由 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.