![](/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.