首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Selenium - Firefox配置文件不识别证书

Selenium - Firefox配置文件不识别证书
EN

Stack Overflow用户
提问于 2020-04-08 17:12:31
回答 1查看 1.2K关注 0票数 1

我需要使用selenium自动选择我自己的证书。在一些研究之后,我发现最好的方法是创建Firefox配置文件,添加证书,并在Selenium中“导入”我的配置文件。

我想做什么?

  • 在Firefox上创建配置文件用户
  • 添加我的证书
  • 硒进口此配置文件

发生了什么?

代码语言:javascript
复制
# Open My Profile
profile = webdriver.FirefoxProfile('/home/USERNAME/.mozilla/firefox/ri4nkdyn.default')

# Preferences that I tested
profile.set_preference("security.default_personal_cert", "Select Automatically")
profile.set_preference("security.osclientcerts.autoload", True)
profile.set_preference("security.disable_button.openCertManager", True)
profile.set_preference("security.enterprise_roots.enabled", True)
profile.set_preference("accept_untrusted_certs", True)
profile.set_preference("assume_untrusted_cert_issuer", True)

# Firefox Binary
ff_binary = FirefoxBinary('/usr/bin/firefox')

# Desired Capabilities that I tested
desired_capabilities = DesiredCapabilities.FIREFOX.copy()
desired_capabilities["acceptInsecureCerts"] = True
desired_capabilities['acceptSslCerts'] = True


# Create the Webdriver Firefox
driver = webdriver.Firefox(
    firefox_binary=ff_binary,
    firefox_profile=profile,
    desired_capabilities=desired_capabilities
)

我怎么能解决这个问题?怎么了?

EN

Stack Overflow用户

发布于 2021-01-20 13:40:42

通过选择cert编辑firefox配置文件。或在浏览器地址栏中键入"about:config“。验证首选项名称"security.default_personal_cert“设置为”自动选择“,然后使用该配置文件进行火狐测试。

票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61106232

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档