![](/img/trans.png)
[英]SSL/TLS operations failing PHP5.6 - curl-ca-bundle.crt & cacert.pem
[英]How to use a CA (like curl's --cacert) with HTTPie
在 curl 中,我可以像这样使用私钥、客户端证书和 ca 证书进行连接
curl --cert cert.pem --key key.pem --cacert ca.pem https://example.org
我可以在 HTTPie 中看到 --cert 和 --cert-key 选项,但是如何在 HTTPie 中使用 --cacert 选项?
我尝试将 cert.pem 和 ca.pem 组合在一个新文件中并将其用作我的 --cert 文件,但这不起作用。
我明白了。 在 HTTPie 中,您只需像这样使用 --verify 传递 ca.pem
http --cert cert.pem --cert-key key.pem --verify ca.pem http://example.org
另一种选择是利用HTTPie Configurable 选项为任何http
调用自动传递--verify
标志:
~/.config/httpie/config.json
{
"default_options": [
"--verify=/path/to/ssl/custom_ca_bundle.pem"
]
}
这样你就可以继续调用HTTPie,而无需每次都手动传递--verify
!
http https://local.dev
回复:
HTTP/1.1 200 OK
Content-Type: application/json
Server: nginx
...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.