curl-users
curl: (58) unable to set private key file: 'server-cert.pem' type PEM
From: thomas Armstrong <tarmstrong_at_gmail.com>
Date: Fri, 18 Jan 2008 11:17:38 +0100
Date: Fri, 18 Jan 2008 11:17:38 +0100
Hi.
Using Curl on Linux, I'm trying to connect a webservice by using a SSL
certificate, but I get this error message:
######################
[]# curl -d "name=John&phone=555" -G -v --cert server-cert.pem:xxxx
http://remoteserver.com/webservice.asp
ERROR: curl: (58) unable to set private key file: 'server-cert.pem' type PEM
######################
This is the way I used to generate 'server-cert.pem':
######################
[]# openssl req -x509 -newkey rsa:2048 -keyout cakey.pem -days 3650
-out cacert.pem
[]# openssl genrsa -des3 -out serv-priv.pem -passout pass:xxxx 2048
[]# openssl req -new -subj "/DC=mydomain.com/OU=comCN=mydomain" -key
serv-priv.pem -passin pass:xxxx -out serv-cert-request.pem
[]# vi config1.txt
--- basicConstraints = critical,CA:FALSE extendedKeyUsage = serverAuth ---- []# openssl x509 -CA cacert.pem -CAkey cakey.pem -req -in serv-cert-request.pem -days 3650 -extfile config1.txt -sha1 -CAcreateserial -out server-cert.pem ################# I also tried with another method, but I got the same error message: ###################### []# curl -d "name=John&phone=555" -G -v --key cakey.pem --cacert cacert.pem --cert server-cert.pem:xxxx http://remoteserver.com/webservice.asp ERROR: curl: (58) unable to set private key file: 'cakey.pem' type PEM ####################### Any suggestion?Received on 2008-01-18