cURL with SSL certificates fails: error 58 unable to set private key file

后端 未结 2 1933
天命终不由人
天命终不由人 2020-12-17 18:13

I\'m trying to connect to a remote host using cURL. The connection requires the use of a certificate and a private key which is password protected. So far I\'m unsuccessful

2条回答
  •  轮回少年
    2020-12-17 18:27

    I've fixed this problem. I think, due to the number of questions regarding this issue and number of different solutions, others will benefit from the solution. Here goes:

    I used the openssl CLI program to convert the .p12 key-file to a .pem key-file. The trick is the way the conversion takes place.

    First I converted it with this command and I had the issue as described in the question:

    openssl pkcs12 -in key.p12 -out key.pem -nodes -clcerts

    While the command below did the actual trick:

    openssl pkcs12 -in key.p12 -out key.pem -clcerts

    For more info please see the source I used: https://community.qualys.com/docs/DOC-3273

提交回复
热议问题