首页 > 解决方案 > curl 将密码短语与命令行一起传递

问题描述

我正在使用以下命令:

curl -X GET -k --header "Accept: text/plain" --key privateKey.pem --cert publicCert.pem --cacert ca.crt "https://example.org/update"

执行此命令后,系统要求我输入密码:

Enter PEM pass phrase: 

如何将短语与命令行一起传递,因此不需要手动干预。

标签: curl

解决方案


正如@dave 所建议的那样,添加--pass成功了

curl -X GET -k --header "Accept: text/plain" --key privateKey.pem --cert publicCert.pem --cacert ca.crt "https://example.org/update" --pass myPassword

推荐阅读