14. 成功解决:ERROR:ssl_client_socket_impl.cc(992) handshake failed; returned -1, SSL error code 1, net_error -103

简介: 今天使用 Python 的 selenium 时,一直在报如下错误:[30616:22540:0328/093748.004:ERROR:ssl_client_socket_impl.cc(992)] handshake failed; returned -1, SSL error code 1, net_error -100

1e619b9cf78f5265580449a3b3665110_image_auth_key=1686704894-5SBZfm4jPdfahMtPt1MRPs-0-43edbb975ad7f3ebdadc50e77d9e063c&file_size=332738.png

❤️ 个人主页:水滴技术
🌸 订阅专栏:成功解决 BUG 合集
🚀 支持水滴:点赞👍 + 收藏⭐ + 留言💬

问题描述

今天使用 Python 的 selenium 时,一直在报如下错误:

[30616:22540:0328/093748.004:ERROR:ssl_client_socket_impl.cc(992)] handshake failed; returned -1, SSL error code 1, net_error -100

详细错误截图:

37572d796414a3357e9a4b292f5d977a_image_auth_key=1686704907-A2D4fo8SYUwaFTzQTG18d-0-70e0261f971cb76360e8b4f7054c9855&file_size=58873.png

虽然该错误不会影响正常使用,但一直刷屏也很是烦人,于是想彻底解决一下。

解决方案

该提示是由于不安全的地址导致的,需要把这个错误屏蔽掉,可以使用 --ignore-certificate-errors 来屏蔽。屏蔽后发现还有其他错误提示,也一并解决了。

主要添加了三项:

# 忽略证书错误
options.add_argument('--ignore-certificate-errors')
# 忽略 Bluetooth: bluetooth_adapter_winrt.cc:1075 Getting Default Adapter failed. 错误
options.add_experimental_option('excludeSwitches', ['enable-automation'])
# 忽略 DevTools listening on ws://127.0.0.1... 提示
options.add_experimental_option('excludeSwitches', ['enable-logging'])

下面是完整代码:

# http://chromedriver.storage.googleapis.com/index.html
service = Service("D:\chromedriver.exe")

# 配置选项
options = webdriver.ChromeOptions()
# 忽略证书错误
options.add_argument('--ignore-certificate-errors')
# 忽略 Bluetooth: bluetooth_adapter_winrt.cc:1075 Getting Default Adapter failed. 错误
options.add_experimental_option('excludeSwitches', ['enable-automation'])
# 忽略 DevTools listening on ws://127.0.0.1... 提示
options.add_experimental_option('excludeSwitches', ['enable-logging'])

# 获取驱动
driver = webdriver.Chrome(service=service, options=options)

重启后问题解决。


热门专栏

👍 《Python入门核心技术

👍 《IDEA 教程:从入门到精通

👍 《Java 教程:从入门到精通

👍 《MySQL 教程:从入门到精通

👍 《大数据核心技术从入门到精通

相关文章
|
6月前
|
网络安全 Python
python request SSL error 403证书错误
python request SSL error 403证书错误
77 0
|
1天前
|
存储 Web App开发 安全
如何处理错误消息 HTTP error 421 occurred SSL handshake with github.com
如何处理错误消息 HTTP error 421 occurred SSL handshake with github.com
5 0
|
1天前
|
消息中间件 Kafka
org.apache.kafka.common.KafkaException: Socket server failed to bind to 114.115.20.100:9092: Cannot
org.apache.kafka.common.KafkaException: Socket server failed to bind to 114.115.20.100:9092: Cannot
12 0
|
1天前
【Error】fatal: unable to access ‘https://github.com/PanJiaChen/vue-element-admin/‘: OpenSSL SSL_read:
【Error】fatal: unable to access ‘https://github.com/PanJiaChen/vue-element-admin/‘: OpenSSL SSL_read:
|
5月前
DevTools failed to load source map: Could not load content for…System error: net::ERR_FILE_NOT_FOUN
DevTools failed to load source map: Could not load content for…System error: net::ERR_FILE_NOT_FOUN
|
7月前
|
缓存 Shell 网络安全
Github-推送代码报错“error:RPC failed;curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL,errno 10054”解决方案
Github-推送代码报错“error:RPC failed;curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL,errno 10054”解决方案
133 0
|
10月前
Net: Board Net Initialization Failed No ethernet found.
Net: Board Net Initialization Failed No ethernet found.
161 0
|
1天前
|
域名解析 应用服务中间件 Linux
【服务器】使用域名解析服务器的IP地址并配置SSL证书
【服务器】使用域名解析服务器的IP地址并配置SSL证书
536 0
|
1天前
|
前端开发 应用服务中间件 Linux
nginx解决springcloud前后端跨域问题,同时配置ssl
nginx解决springcloud前后端跨域问题,同时配置ssl
|
1天前
|
应用服务中间件 网络安全 nginx
Nginx配置SSL证书时——nginx:[emerg]unknowndirectivessl错误
Nginx配置SSL证书时——nginx:[emerg]unknowndirectivessl错误
161 0

热门文章

最新文章