尝试使用Python WebDriver和FirefoxProfile找到一种使用Selenium在Firefox中安装特定SSL证书的方法.我们需要使用我们自己的自定义证书,该证书存储在运行WebDriver的计算机中,因此理想的解决方案如下所示:
profile = get_my_profile()
profile.importCertificate('/my/certificates/my_cert.cert')
driver = new webdriver.Firefox(profile=profile)
我怎样才能做到这一点?
非常感谢!
解决方法:
Webdriver has no built in mechanism for adding a personal cert.
If you are using firefox the only way that I have found to do this is
to create a firefox profile and add the certificate to it. You can
then either reuse the profile when you run your tests OR, and this is
my prefered option, take the cert8.db and key3.db files and add them
to the profile that webdriver creates at runtime. – 07001
虽然下一个答案提供了workaround.