我使用KarateDSL测试Rest API,这非常好。但目前我正试图通过客户端TLS证书发送带有身份验证的请求。
Curl看起来像这样:
curl -X POST https://<urlOfEndPoint> -d '{ "id":"First","status":"Active" }' --cert cert.crt:password --key cert.key --insecure
是否有某种方式,如何从空手道发送此请求?或者一些解决方法?
提前谢谢
答案 0 :(得分:-1)
请参阅文档和示例:https://github.com/intuit/karate#x509-certificate-authentication
# enable X509 certificate authentication with PKCS12 file 'certstore.pfx' and password 'certpassword'
* configure ssl = { keyStore: 'classpath:certstore.pfx', keyStorePassword: 'certpassword', keyStoreType: 'pkcs12' };