I have a cetificate chain in .pem format from Letsencrypt, called fullchain.pem
It has 2 certificates in the chain:
keytool -printcert -v -file fullchain.pem |grep "Certificate fingerprints" |wc -l
2
When I convert it to .der using
openssl x509 -in fullchain.pem -out cert.der -outform DER
it only exports the last one
keytool -printcert -v -file cert.der |grep "Certificate fingerprints" |wc -l
1
is this a bug in openssl? Am I missing a param?
openssl x509processes only the first cert in the input file and ignores any additional ones. You need to split 'fullchain' up and process each cert separately. See https://serverfault.com/questions/391396/how-to-split-a-pem-file and https://serverfault.com/questions/590870/how-to-view-all-ssl-certificates-in-a-bundle – dave_thompson_085 Aug 31 '17 at 19:33