【问题标题】:REST-Requests not executed in newman due to not correct usage of ssl-certificates由于未正确使用 ssl 证书,REST 请求未在 newman 中执行
【发布时间】:2017-11-29 09:44:09
【问题描述】:

我目前正在使用 Newman 自动测试我的 Rest-API 调用。

问题是我可以在 Postman 中毫无问题地运行我的所有测试,在 Postman 中使用证书(.pem 和 pkcs8)进行 ssl 授权也不是问题。但是当我尝试在命令行上将 Collection 加载到 Newman 中时,我无法运行测试,因为在 Postman 中正确推荐的证书在 Newman 中不正确推荐。

如果我运行:

newman run postman_collection.json --ssl-client-cert cert.pfx --ssl-client-passphrase passphrase

然后没有请求被执行。如果我改为使用:

newman run postman_collection.json --ssl-client-cert cert.crt --ssl-client-key key.pkcs8 client-passphrase passphrase

so 分别使用密钥和授权证书(cert.crt、key.pkcs8)而不是在 .pfx 文件中一起使用,然后它执行请求但说它“无法验证第一个证书”,所以每个请求都返回一个错误。

我该如何解决这个问题?

【问题讨论】:

    标签: ssl newman


    【解决方案1】:

    您可以使用参数 --insecure 而不是参数“--ssl-client-cert cert.crt --ssl-client-key key.pkcs8 client-passphrase passphrase”来解决此问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-12
      • 1970-01-01
      • 2023-03-05
      • 2022-11-20
      • 2015-11-26
      • 2016-01-26
      • 1970-01-01
      • 2015-06-22
      相关资源
      最近更新 更多