You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在h2load中指定ca证书、客户端证书及密钥执行请求测试

h2load 证书及请求参数配置方法

参数映射关系

你现有curl命令中的各个参数和h2load参数一一对应规则如下:

  • CA根证书指定:curl的--cacert 对应h2load的--cacert
  • 客户端证书指定:curl的--cert 对应h2load的--cert
  • 客户端私钥指定:curl的--key 对应h2load的--key
  • 跳过证书校验:curl的--insecure 对应h2load的-k/--insecure
  • POST请求体传递:curl的-d 对应h2load的-d/--data,携带该参数时h2load默认使用POST请求方法,也可加-m POST显式指定请求方法。

适配后的压测命令示例

h2load -k https://xxx.xxx.xxx.xxx:18093/endpoint \
  --cacert myCaCrtFile.crt \
  --cert myCertFile.crt \
  --key myKey.key \
  -d ./data.json

常用压测参数补充

如果需要调整压测的并发、请求量配置,可额外添加以下参数:

  • -n <数字>:设置总请求数
  • -c <数字>:设置并发连接数
  • -t <数字>:设置压测使用的线程数

内容的提问来源于stack exchange,提问作者torpido

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.03 17:36:00