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!

Търсене в помощните статии

Избягвайте измамите при поддръжката. Никога няма да ви помолим да се обадите или изпратите SMS на телефонен номер или да споделите лична информация. Моля, докладвайте подозрителна активност на "Докладване за злоупотреба".

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.