我正在我的项目中为 Testrail 实现 Python 客户端(http://docs.gurock.com/testrail-api2/bindings-python)
我正在运行 API 调用“get_test”并且收到如下错误
File "playground.py", line 10, in <module>
case = client.send_get('get_test/53948')
File "/Users/bhdev/Work/Python/TBH/testrail.py", line 36, in send_get
return self.__send_request('GET', uri, None)
File "/Users/bhdev/Work/Python/TBH/testrail.py", line 70, in __send_request
response = urllib.request.urlopen(request).read()
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 526, in open
response = self._open(req, data)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)>
我的代码
from testrail import *
client = APIClient('https://******')
client.user = '*****'
client.password = '******'
case = client.send_get('get_test/xxxx')
print(case)
我怎么能绕过 SSL 证书问题。
谢谢