捲曲 – 無法設定私鑰檔案:’./cert.pem’型別PEM
我使用curl使用公共證書檔案從https站點下載資料.
系統資訊:
>作業系統:fedora 14
捲曲:捲曲7.30.0
> openssl:OpenSSL 1.0.0a-fips
命令是,
curl -v "https://<ip:<port>" --cert "./cert.pem" --cacert "./cacert.pem" --cert-type PEM * About to connect() to kng.com port 443 (#0) *Trying 11.19.37.123... * Adding handle: conn: 0x8189e68 * Adding handle: send: 0 * Adding handle: recv: 0 * Curl_addHandleToPipeline: length: 1 * - Conn 0 (0x8189e68) send_pipe: 1, recv_pipe: 0 * Connected to fkng.com (11.19.37.123) port 443 (#0) * unable to set private key file: './cert.pem' type PEM * Closing connection 0 curl: (58) unable to set private key file: './cert.pem' type PEM
我已經給了所有的許可權的.pem檔案,仍然捲曲是丟擲一個錯誤.
謝謝
後,看起來證書的私鑰不在同一個檔案中.如果它在不同的檔案中,您需要使用–key檔案提供它並提供密碼.
因此,請確保cert.pem具有私鑰(連同證書)或使用–key選項提供.
此外,本文件提到
請注意,此選項假定一個“證書”檔案是私鑰和私有證書級聯!
他們如何連線?這很容易將它們一個接一個放在同一個檔案中.
您可以在here 上獲得更多幫助.
我相信這可能會幫助你.
http://stackoverflow.com/questions/16624704/unable-to-set-private-key-file-cert-pem-type-pem