简体   繁体   中英

Apache SSL Converting itermediateCA.cer to crt with openssl

Try to convert IntermidiateCA.cer to crt formmat for Apache but I couldn't. I use the following command below:

openssl x509 -inform DER -in IntermediateCA.cer -out IntermediateCA.crt

This the error I got below

unable to load certificate
4276141236:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong 
tag:tasn_dec.c:1198:
 4276141236:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested 
asn1 error:tasn_dec.c:372:Type=X509

Kindly note the server is solaris 5.10

There are two common certificate encoding types. If you can read the "----BEGIN CERTIFICATE----" then it's PEM encoded. If not, DER (binary) encoded. Trying to convert with the openssl x509 command specifying the wrong encoding will produce the error you got.

If certificate file is DER encoded (binary)

openssl x509 -inform DER -in certificate.cer -out certificate.crt

If certificate is PEM encoded (human readable)

openssl x509 -inform PEM -in certificate.cer -out certificate.crt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM