1

I am using below command

curl   --insecure  --cert 'cert.p12:password'  -X GET   https://serverUrl   -H 'Content-Type: application/json'


curl   --insecure --cert-type P12 --cert 'cert.p12:password'  -X GET   https://serverUrl   -H 'Content-Type: application/json'

it's not working in Ubuntu 16.04.4 LTS \n \l (AWS lightsail) and giving below error

curl: (35) error reading X.509 potentially-encrypted key file: Error in parsing.

but working in Ubuntu 18.04.3 LTS \n \l (LOCAL SYSTEM)

1 Answer 1

0

As In Ubuntu 16.04.4 LTS P12 file does not support so we can use below command

PKCS#1 Private key

openssl pkcs12 -in cert.p12 -nocerts -out privateKey.pem 

Certificates:

openssl pkcs12 -in cert.p12 -clcerts -nokeys -out publicCert.pem

We can use the below command to call API

curl -k --cert ./publicCert.pem --cert-type PEM --key ./privateKey.pem --key-type PEM --pass password  -X GET   https://serverUrl   -H 'Content-Type: application/json'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .