cURL / Mailing Lists / curl-users / Single Mail

curl-users

How to use .pfx in certificate store in CURL via SSL from Windows 7

From: Brendan White <brendan.white_at_flinders.edu.au>
Date: Thu, 5 Mar 2015 00:01:34 +0000

Friends

I want to use cURL to access a remote server, and I need to identify myself using a private key, otherwise 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'm confident 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 12.34.56.78...
        * Connected to secure.server.com (12.34.56.78) 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? 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? Or is this just impossible?

Many thanks,
        Brendan.

PS - Full disclosure - I posted this question to SuperUser (http://superuser.com/questions/884812/how-to-use-pfx-in-certificate-store-in-curl-for-windows-7) a couple of days ago, but have not received any answers.

--
Brendan White 
Business Analyst
Student Systems, Flinders University
brendan.white_at_flinders.edu.au 
ph +618 8201 5967, fax +618 8201 2580, web www.flinders.edu.au
CRICOS Registered Provider: The Flinders University of South Australia 
CRICOS Provider Number: 00114A 
This email and any attachments may be confidential. If you are not the intended recipient, please inform the sender by reply email and delete all copies of this message.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2015-03-05