selenium自动化学习--解决firefox无法建立安全连接的问题(TLS1.0/TLS1.1)

解决Firefox+selenium无法建立安全连接的问题SSL_ERROR_UNSUPPORTED_VERSION

问题:

在使用python+selenium做firefox浏览器自动化测试的时候,遇到了如下问题:
在这里插入图片描述代码如下:
profile = webdriver.FirefoxProfile()
profile.set_preference(‘network.proxy.type’, 1)
profile.set_preference(‘network.proxy.http’, proxy_host)
profile.set_preference(‘network.proxy.http_port’, proxy_port)
profile.set_preference(“network.proxy.share_proxy_settings”, True)
profile.set_preference(‘network.proxy.ssl’, proxy_host)
profile.set_preference(‘network.proxy.ssl_port’, proxy_port)
profile.accept_untrusted_certs = True
profile.assume_untrusted_cert_issuer = False
driver = webdriver.Firefox(firefox_profile=profile)
driver.maximize_window()
driver.get(‘https://xxxxxxx’)

解决方案:

查阅很多资料没有得到正确的结果,或许没有查到正确的途径,后经人告知,在此记录,分享给有需要的人
在这里插入图片描述

profile.set_preference(“security.tls.version.min”,1)
更改这个值,可解决这个问腿.
根据网上只言片语的总结,最新的Firefox对低版本的TLS不支持,默认的最低是3,我们更改tls为1,让tls有效
TLS (Transport Layer Security),以前称为安全套接字层(SSL),是一种应用程序用来在网络上安全通信的协议

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值