How to import SSL certificates for Firefox with Selenium [in Python]?

Trying to find a way to install a specific SSL certificate in Firefox with Selenium using Python WebDriver and FirefoxProfile. We need to use our own private certificate, which is stored on a computer with WebDriver, so the ideal solution would look like this:

profile = get_my_profile() profile.importCertificate('/my/certificates/my_cert.cert') driver = new webdriver.Firefox(profile=profile) 

How can i achieve this?

Many thanks!

+2
source share
1 answer

From this answer

Webdriver does not have a built-in mechanism for adding a personal certificate.

If you use firefox, the only way I found for this is to create a firefox profile and add a certificate to it. You can then reuse the profile when doing OR tests, and this is my preferred option, take the cert8.db and key3.db files and add them to the profile that the webdriver creates at runtime. - Derek Akins

although the following answer provides a workaround.

+2
source

All Articles