【问题】
使用python2.7.10运营python接口测试脚本时,出现告警
InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised.
位置在:
lib/python2.7/site-packages/urllib3/connectionpool.py:857
并且系统指引查看:
See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
【解决】
pip install cryptography
pip install pyOpenSSL
pip install certifi
如果还是不行,
在代码里忽略这种警告,disable_warnings()、verify=True
比如像这样
import requests.packages.urllib3
requests.packages.urllib3.disable_warnings()
如果是robot脚本,则这样添加
Create Session session1 https://www.google.com disable_warnings=1
或
Create Session session1 https://www.google.com verify=True