如何解决如何解决以下严重的银河SSL错误?
开始学习Ansible,并希望使用ansible-galaxy search nginx
命令,但我得到了:
ERROR! Unknown error when attempting to call Galaxy at 'https://galaxy.ansible.com/api/api': <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)>
尝试使用ansible-galaxy --ignore-certs search nginx
和ansible-galaxy -c search nginx
,但现在获得ansible-galaxy: error: unrecognized arguments: --ignore-certs
作为展位。
操作系统:
发行人ID:Ubuntu 说明:Ubuntu 18.04.5 LTS 发行:18.04 代号:bionic
Ansible版本:
ansible 2.9.5
config file = /home/maciej/projects/priv/ansible_nauka/packt_course/ansible.cfg
configured module search path = ['/home/maciej/.ansible/plugins/modules','/usr/share/ansible/plugins/modules']
ansible python module location = /home/maciej/.local/lib/python3.6/site-packages/ansible
executable location = /home/maciej/.local/bin/ansible
python version = 3.6.9 (default,Jul 17 2020,12:50:27) [GCC 8.4.0]
解决方法
为我工作:
ansible-galaxy search --ignore-certs postgresql
,
我有同样的问题,但是在Mac OS X上。
潜在的问题是您的Python环境没有找到/利用您的OS上安装的默认根证书。需要这些根证书才能通过Ansible Galaxy安全地(通过TLS)连接。
对于Mac OS X ,我可以根据以下答案解决此问题: How to make Python use CA certificates from Mac OS TrustStore?
即通过运行脚本来安装证书,该脚本随安装一起提供:
file:pip*
对于Ubuntu :
- 您可能会遵循此处描述的方法: Python using system SSL certificates?
- ..或采用
cd /Applications/Python\ 3.7/ ./Install\ Certificates.command
软件包:certifi
的简单方法,该软件包将为您的Python环境安装所有根证书。
PS :我不建议使用pip install certifi
,这将跳过TLS连接中证书的验证,从而使连接不安全(允许Man-in-the-middle attacks)>
回到这个问题......生活是最好的动力。对我有帮助的是:
sudo update-ca-certificates --fresh
export SSL_CERT_DIR=/etc/ssl/certs
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。