Closed matteoredaelli closed 3 years ago
Hi @matteoredaelli. How do you accomplish this using curl? Could you provide an example? I want to be sure I understand what the feature is.
A sample command is
curl --cert certificates/prd/client.pem --insecure --key certificates/prd/client_key.pem https://localhost:4242/qrs/dataconnection/full?xrfkey=0123456789abcdef --header "x-qlik-xrfkey: 0123456789abcdef" --header "X-Qlik-User: UserDirectory=internal;UserId=sa_repository" -H "Content-Type: application/json"
I asked the same question elsewhere (issues in request.el project) and they suggested
(let ((request-curl-options (split-string "--key ./admin-key.pem --cert ./admin.pem"))
(request-backend 'curl))
(request
"http://XXXXX/get"
...
Hmm, I think this could be accomplished via some auth-source
configuration. See here: https://www.gnu.org/software/emacs/manual/html_mono/auth.html#Help-for-users.
Assuming that your auth-sources
variable contains "~/.authinfo"
, maybe you could try placing the following contents in your ~/.authinfo
file:
machine localhost port 4242 key certificates/prd/client_key.pem cert certificates/prd/client.pem
(note that you might need to make those two paths absolute instead of relative)
Then you should also set network-stream-use-client-certificates
to t
and possibly restart Emacs.
@matteoredaelli did that work for you? If it did, we can close this issue.
ok thanks
I need to do get/post requets to a https site using certificates. I can do it with curl, I'd like to do using this nice package...