Open narendraj9 opened 6 years ago
Client certificates seem to have better support in Emacs 27. I did the following to get restclient
to talk to a host with a certificate:
network-stream
to look for matching certificates: (setq network-stream-use-client-certificates t)
~/.authinfo
like this
machine host.example.com port 443 key /path/to/key cert /path/to/cert
No special configuration of restclient
itself is needed.
@mpolden Do you have any idea if restclient
package can handle p12
cert types though authinfo
?
This is how it is done in curl
curl --cert-type p12 --cert cert.pfx:${password} -X GET https://${url}/ -H 'Content-Type: application/json'
cert.pfx
is a certificate file.
I know that I can rewrite @narendraj9's do-it-with-curl
function accordingly but Is there elegant way like you mentioned above?
Thanks
Can confirm that @mpolden Emacs auth-source works.
Of course key
and cert
can be generate from p12
-
openssl pkcs12 -in mycert.p12 -out file.key.pem -nocerts -nodes
openssl pkcs12 -in mycert.p12 -out file.crt.pem -clcerts -nokeys
Currently, here is what I do:
This uses some variables that need to be defined and curl needs to be installed.