我正在尝试将通配符SSL证书转换为PEM格式,以便我可以在亚马逊的Cloudfront中使用它 . 我唯一可用的文件格式是pfx . 我尝试使用以下命令:
Extract the private key from the PFX
openssl pkcs12 -in {site}.pfx -nocerts -nodes -passin pass:{password} | openssl rsa -out {site}.key
Extract the public key from the PFX
openssl pkcs12 –in {site}.pfx -clcerts -nokeys -passin pass:{password} | openssl x509 -out {site}.cer
Extract the chain bundle from the PFX
openssl pkcs12 -in {site}.pfx -nodes -nokeys -cacerts -passin pass:{password} | openssl x509 -out bundle.crt
前两个命令运行没有任何问题,但最后一个命令返回以下内容:
MAC verified OK
unable to load certificate
17856:error:0906D06C:PEM routines:PEM_read_bio:no start line:.\crypto\pem\pem_lib.c:701:Expecting: TRUSTED CERTIFICATE
任何帮助将不胜感激!
1 回答
使用
openssl
中的pkcs12
上下文,您可以从pfx文件中指定所需的组件 . 如果您不想要签名证书而只需要颁发者证书,请尝试以下操作:openssl pkcs12 -in mycerts.pfx -cacerts -out myissuercerts.cer
要获取crt文件扩展名,只需将文件从.cer重命名为.crt . http://www.networksolutions.com/support/what-is-the-difference-between-a-crt-and-a-cer-file/
希望这可以帮助 .