【问题标题】:Newman loads the pfx certificate but it is not used to connect to the endpointNewman 加载 pfx 证书,但不用于连接到端点
【发布时间】:2021-07-02 12:11:46
【问题描述】:

我在执行来自 newman 的邮递员集合时遇到问题,其中涉及加载 pfx 证书以建立 TLSMA 连接。

从 Postman 应用程序中,证书已正确加载(从设置中)并用于域 https://domain1.com 与 TLSMA 对应服务器连接。

当我导出 json 集合和环境时,没有提及相关的域和证书。

检查 json 架构 here newman 接受请求中的证书定义,但应用它不起作用,这里是我的示例:

 "request": {
    "method": "GET",
    "header": [],
    "certificate": {
      "name": "Dev or Test Server",
      "matches": ["https://domain1.com/*"],
      "cert": { "src": "./certificate.pfx" }
    },
    "url": {
      "raw": "https://domain1.com/as/authorization.oauth2",
      "host": ["https://domain1.com"],
      "path": ["as", "authorization.oauth2"],
      "query": [
        {

我还尝试在外部文件 cert-list.json 中应用证书配置,内容如下:

[{
    "name": "Dev or Test Server",
    "matches": ["https://domain1.com/*"],
    "cert": { "src": "./certificate-t.pfx" }
  }]

但它也不起作用。

这里是 newman 命令:

newman run domain.postman_collection.json -n 1 --ssl-client-cert-list cert-list.json  -e env.postman_environment.json -r cli --verbose

你知道我哪里做错了吗?

【问题讨论】:

    标签: ssl certificate postman pfx newman


    【解决方案1】:

    将证书更改为 pfx 试试:

    [{
      "name": "Dev or Test Server",
      "matches": ["https://domain1.com/*"],
      "pfx": { "src": "./certificate-t.pfx" }
    }]
    

    【讨论】:

    • 谢谢!这也对我有用,方法是创建一个带有 .pfx 路径的单独 json 文件,然后传递给 newman。 newman run 'collection.json' --environment 'my-env.json' --ssl-client-cert-list cert.json
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-09-18
    • 1970-01-01
    • 2016-04-26
    • 2017-08-02
    • 1970-01-01
    • 2017-06-01
    • 2019-12-09
    相关资源
    最近更新 更多