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

如何在Newman请求中传入SSL证书(含PFX/CER/KEY文件)

在Newman中传入PFX、CER/KEY证书运行Postman集合

1. 处理PFX(PKCS#12)证书

PFX文件已包含私钥与证书链,直接通过Newman的--pfx参数指定文件路径;若PFX设有密码,需追加--pfx-passphrase参数传入密码:

newman run 你的集合文件.json --pfx "/绝对路径/your-cert.pfx" --pfx-passphrase "pfx密码"

2. 处理分离的CER(公钥证书)+ KEY(私钥)文件

针对分开存储的CER和KEY文件,需分别用--ssl-client-cert和--ssl-client-key指定路径;若私钥设有密码,再添加--ssl-client-key-passphrase参数:

newman run 你的集合文件.json --ssl-client-cert "/绝对路径/your-cert.cer" --ssl-client-key "/绝对路径/your-private.key" --ssl-client-key-passphrase "key密码"

额外提示

  • 路径优先使用绝对路径,若用相对路径需确保是Newman运行目录的相对位置,避免文件找不到
  • 频繁执行可将命令写入Shell脚本或Batch脚本,减少重复输入参数的麻烦

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.23 10:54:49