python locust接口性能测试HTTPS网站报错:Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certi
来源:互联网 发布:stereo 32软件应用 编辑:程序博客网 时间:2024/05/22 03:06
问题描述:
测试HTTPS SSL 协议的网站接口,用Python Locust模块,不论POST还是GET都提示错误:
SSLError
Max retries exceeded with url: /action.php?m=upload
(Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)'),))",),)
后面查官网locust.io,终于找到解决方法:https://docs.locust.io/en/latest/api.html
request
(method, url, name=None, catch_response=False, **kwargs)Constructs and sends a requests.Request
. Returns requests.Response
object.
- method – method for the new
Request
object. - url – URL for the new
Request
object. - name – (optional) An argument that can be specified to use as label in Locust’s statistics instead of the URL path. This can be used to group different URL’s that are requested into a single entry in Locust’s statistics.
- catch_response – (optional) Boolean argument that, if set, can be used to make a request return a context manager to work as argument to a with statement. This will allow the request to be marked as a fail based on the content of the response, even if the response code is ok (2xx). The opposite also works, one can use catch_response to catch a request and then mark it as successful even if the response code was not (i.e 500 or 404).
- params – (optional) Dictionary or bytes to be sent in the query string for the
Request
. - data – (optional) Dictionary or bytes to send in the body of the
Request
. - headers – (optional) Dictionary of HTTP Headers to send with the
Request
. - cookies – (optional) Dict or CookieJar object to send with the
Request
. - files – (optional) Dictionary of
'filename': file-like-objects
for multipart encoding upload. - auth – (optional) Auth tuple or callable to enable Basic/Digest/Custom HTTP Auth.
- timeout (float or tuple) – (optional) How long to wait for the server to send data before giving up, as a float, or a (connect timeout, read timeout) tuple.
- allow_redirects (bool) – (optional) Set to True by default.
- proxies – (optional) Dictionary mapping protocol to the URL of the proxy.
- stream – (optional) whether to immediately download the response content. Defaults to
False
. - verify – (optional) if
True
, the SSL cert will be verified. A CA_BUNDLE path can also be provided. - cert – (optional) if String, path to ssl client cert file (.pem). If Tuple, (‘cert’, ‘key’) pair.
这是HTTPS网站所做的SSL证书认证,默认是True的,设置为False之后对测试没有影响;
当然如果知道证书的路径,应该也可以用cert设置.pem文件的路径,也可以解决
阅读全文
0 0
- python locust接口性能测试HTTPS网站报错:Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certi
- python SSLError CERTIFICATE_VERIFY_FAILED InsecureRequestWarning
- 银豹 PYTHON requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed
- win7 python3 解决 (SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_s
- SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
- python请求https报错[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed
- webview使用sslError解决https跳转报错的问题
- requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581
- Python访问https报错CERTIFICATE_VERIFY_FAILED
- python wechat_sdk SSLError
- SSLError(SSLError(1, '_ssl.c:510: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:
- python用requests请求百度接口报“SSL: CERTIFICATE_VERIFY_FAILED”
- Python网络爬虫报错“SSL: CERTIFICATE_VERIFY_FAILED”的解决方案
- Python报错: urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED]
- Python Requests throwing up SSLError
- 用python发送QQ邮件遇到的错误记录(ssl.SSLError: [Errno 1] _ssl.c:504)
- python使用requests时报错requests.exceptions.SSLError: HTTPSConnectionPool
- ERROR: While executing gem ... (OpenSSL::SSL::SSLError)
- 《软件开发者路线图:从学徒到高手》【PDF】下载
- java发展史
- wirecast 中文版 | Wirecast(在线直播软件)官方中文破解版V8.1下载
- 面部识别“大不一样”,vivo Y66i 正式开售
- FIT 2017 中译语通语言科技领跑行业变革
- python locust接口性能测试HTTPS网站报错:Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certi
- 父页面调用子页面函数和元素,亲测可行
- 虹软:3D+AI助力安卓手机超越iPhone X
- Discuz搭建论坛报错:advice_mysqli_connect
- 独家专访金磊:“清华帮”网易有道要做教育界的京东
- 网易荒野行动不惜成本,多重组合拳凸显反挂决心
- 数据结构课程总结
- Android ListView异步加载图片乱序问题,原因分析及解决方案
- 国产杀软再获佳绩 腾讯电脑管家连续25次获VB100通过认证