我尝试使用 OpenSSL 从 .crt 文件生成新的 .pem 文件。
我执行这个命令行的时候报错
openssl x509 -inform DER -outform PEM -in file.crt -out file.crt -text
消息错误:
140074298443072:error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag:../crypto/asn1/tasn_dec.c:1149:
140074298443072:error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error:../crypto/asn1/tasn_dec.c:309:Type=X509
如果我执行这个命令行,它就可以工作:
openssl x509 -inform DER -in file.crt -out file.pem -text
但是,当我尝试执行这个时:
openssl x509 -inform DER -outform PEM -in file_2.crt -out file_2.pem -text
我有这个错误:
unable to load certificate
139808179582272:error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag:../crypto/asn1/tasn_dec.c:1149:
139808179582272:error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error:../crypto/asn1/tasn_dec.c:309:Type=X509