无法设置私钥

时间:2019-03-11 06:36:56

标签: ssl curl

我有.pem.cer格式的证书。它里面只有证书,没有RSA私钥。如下图所示

------BEGIN CERTIFICATE----------------------
gvhfgvdshjgchjbdhbcdcd
--------END CERTIFICATE----------------------

当我在curl中执行以下命令时,它将失败并显示错误

  

卷曲:(58)无法设置私钥文件:   “ C:/users/aiya/Desktop/payments.pem”类型PEM

curl -kv --cert C:/users/aiya/Desktop/payments.pem  https://api.com/v2/payments

* Trying 184.12.56.561....
* TCP_NODELAY set
* Connected to api.com port 443
* ALPN, offering h2
* ALPN, offering HTTP/1.1
* unable to set private key file : 'C:/users/aiya/Desktop/payments.pem' type PEM
* Closing connection 0
curl: (58) unable to set private key file: 'C:/users/aiya/Desktop/payments.pem' type PEM

我浏览了几篇文章,但没有找到合适的解决方案。 注意:当证书中包含RSA私钥时,以上命令将成功执行

-----BEGIN CERTIFICATE--------------------------
DHGHSVCBHBBBBBDVBDBVVVVVBVDSUYEDUWHUWJHBD8E2892UJE673R6V536TGHB78CK6YEFKN8FYU,I
-------END CERTIFICATE---------------------------------
---------BEGIN RSA PRIVATE KEY--------------
VCGGGGGGGGGGGGGGGGGGGGGGGGGGGGGHFAWTDGGGGGGGGA
----------------END RSA PRIVATE KEY-------------

0 个答案:

没有答案