curl / Mailing Lists / curl-users / Single Mail

curl-users

how to set password for private key with pem for https connection?

From: Jun Sun <jsun_at_junsun.net>
Date: Thu, 4 Apr 2019 20:50:27 -0700

I started with pfx file and converted to pem files with following commands

openssl pkcs12 -in client.pfx -out client.pem (PEM password is "test")
openssl pkcs12 -in client.pfx -out client-nopass.pem -nodes

The nopass version works fine

curl -v -v -k --cert ./client-nopass.pem https://lictest.netspect.com

The password version does not work no matter which ways I tried:

curl -v -v -k --cert ./client.pem --pass test https://lictest.netspect.com
curl -v -v -k --cert ./client.pem:test https://lictest.netspect.com

They all give "error reading X.509 potentially-encrypted key file: Error in
parsing."

Can someone give a pointer? This drives me nuts.

BTW, there is an intermediate certificate embedded in the certificate,
which I don't think is an issue.

Also, my ultimate goal is to simply use pfx file directly without
converting to pem file. Is this possible?

Thanks.

Jun

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-04-05