Openssl Unable to Load Certificate Wrong Asn1 Encoding routines:ASN1_CHECK_TLEN::tag:tasn_dec.c:1319
If you come across this error
1 2 3 4 5 |
|
When trying to validate a certificate using openssl, this is because it is in the wrong format, whilst the certificate file visually appears to be in x.509 format, you will find it contains a far longer base64 string than x.509 certificates of the same bit length.
The format in this case is p7b (PCKS #7); to use the certificate witih apache you’re going to have to convert this.
openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer
Within the resulting .cer file you will file you x.509 certificate bundled with relevant CA certificates, break these out into your relevant .crt and ca.crt files and load as normal into apache.