html tool

2019年4月4日星期四

Failed to reach a server. Reson:[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)


问题: 


切换平台后,没有任何改动的代码提示:

[agent]Failed to reach a server. Reson:[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)


解决:

这个可以成功,python版本是2.7.5 和之前的版本也一致,最后是修改python的配置
https://community.hortonworks.com/questions/120861/ambari-agent-ssl-certificate-verify-failed-certifi.html

  1. sed -i 's/verify=platform_default/verify=disable/' /etc/python/cert-verification.cfg


其他:

这里的指定版本pope的不可以
pip install certifi==2015.04.28



修改发送头,pope用的是post没有找到对应位置

r = requests.get("xxx.com", headers=request_headers, verify=False) 

没有评论:

发表评论