In curl I can connect with a private key, client cert, and a ca cert like this
curl --cert cert.pem --key key.pem --cacert ca.pem https://example.org
I can see the --cert and --cert-key options in HTTPie, but how could I use the --cacert option in HTTPie?
I tried combining cert.pem and ca.pem in a new file and using that as my --cert file, but that didn't work.
I got it. In HTTPie you just pass the ca.pem using --verify like this
http --cert cert.pem --cert-key key.pem --verify ca.pem http://example.org
One additional option is to leverage HTTPie Configurable options to automatically pass the --verify
flag for any http
call:
~/.config/httpie/config.json
{
"default_options": [
"--verify=/path/to/ssl/custom_ca_bundle.pem"
]
}
This way you can continue calling HTTPie without manually passing --verify
each time!
http https://local.dev
Response:
HTTP/1.1 200 OK
Content-Type: application/json
Server: nginx
...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.