I want to use cURL to access a remote server, and I need to identify myself using a private key or the remote server gives a 401 "Unauthorized".
I'm on Windows 7 (work machine, not my choice) and my private key is installed on my computer. I'm not permitted to access it directly, but I believe it's installed in the certificate store correctly. So I want to specify the public key in the cURL command, and let the operating system work out which private key to use.
I've given the public key to the remote server, and they've accepted it and installed it.
So I'm doing this:
curl --verbose --cert "my-public-cert.pem" https://secure.server.com/path
...but it's not working, I'm getting a 58 error:
* Trying 220.127.116.11... * Connected to secure.server.com (18.104.22.168) port 443 (#0) * unable to use client certificate (no key found or wrong pass phrase?) * Closing connection 0 curl: (58) unable to use client certificate (no key found or wrong pass phrase?)
Am I doing something wrong, or is this just impossible? Is there a way to send a cURL request over SSL, if I can't access the private key directly but the operating system has the private key installed?