SSLError: Failed to connect. Please check openssl library versions.

本文详细介绍了当遇到SSLError: Failed to connect错误时的解决步骤,包括检查并更新openssl库版本,验证Python版本,修改证书验证配置,调整Ambari-agent的安全设置,以及重启服务,确保集群组件正常运行。

SSLError: Failed to connect. Please check openssl library versions.

错误描述:

​ 在查看agent的日志时,发现报错
​ SSLError: Failed to connect. Please check openssl library versions.

解决方法:

​ 1.查看openssl版本:

openssl version

​ 如果低于 openssl-1.0.1e-16.el6.x86_64 版本,则需要更新到 openssl-1.0.1e-16.el6.x86_64 及以上版本

​ 2. 查看 Python 版本:

 python -V

​ 如果低于 Python 2.7 版本,则升级 Python 到 2.7 及以上版本。

​ 3.编辑 /etc/python/cert-verification.cfg 配置文件,将 [https] 节的 verify 项设为禁用:

vi /etc/python/cert-verification.cfg

​ 在配置中更改下列参数

[https]
verify=disable

​ 4.编辑 /etc/ambari-agent/conf/ambari-agent.ini 配置文件,在 [security] 节部分,确保设置如下两个值,其它值保持不变:

 vi /etc/ambari-agent/conf/ambari-agent.ini
[security]
ssl_verify_cert=0
force_https_protocol=PROTOCOL_TLSv1_2

​ 5.重启ambari-agent

ambari-agent restart

重新执行,即可通过确认主机并完成注册。

zhihonghe@ubuntu:~/Desktop/test$ wget https://www.zlib.net/fossils/zlib-1.2.7.tar.bz2 --2025-12-03 22:18:10-- https://www.zlib.net/fossils/zlib-1.2.7.tar.bz2 Resolving www.zlib.net (www.zlib.net)... 85.187.148.2 Connecting to www.zlib.net (www.zlib.net)|85.187.148.2|:443... connected. HTTP request sent, awaiting response... 404 Not Found 2025-12-03 22:18:12 ERROR 404: Not Found. zhihonghe@ubuntu:~/Desktop/test$ zhihonghe@ubuntu:~/Desktop/test$ zhihonghe@ubuntu:~/Desktop/test$ zhihonghe@ubuntu:~/Desktop/test$ ls constraints.txt offline_packages offline_packages.tar.gz zhihonghe@ubuntu:~/Desktop/test$ zhihonghe@ubuntu:~/Desktop/test$ wget https://www.openssl.org/source/old/1.0.2/openssl-1.0.2a.tar.gz --2025-12-03 22:18:21-- https://www.openssl.org/source/old/1.0.2/openssl-1.0.2a.tar.gz Resolving www.openssl.org (www.openssl.org)... 34.49.79.89, 2600:1901:0:d50b:: Connecting to www.openssl.org (www.openssl.org)|34.49.79.89|:443... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: https://github.com/openssl/openssl/releases/download/OpenSSL_1_0_2a/openssl-1.0.2a.tar.gz [following] --2025-12-03 22:18:23-- https://github.com/openssl/openssl/releases/download/OpenSSL_1_0_2a/openssl-1.0.2a.tar.gz Resolving github.com (github.com)... 20.205.243.166 Connecting to github.com (github.com)|20.205.243.166|:443... connected. ERROR: cannot verify github.com's certificate, issued by ‘CN=TP-LINK SANGFOR,O=TP-LINK,L=SZ,ST=GD,C=CN’: Unable to locally verify the issuer's authority. To connect to github.com insecurely, use `--no-check-certificate'.
最新发布
12-05
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值