Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different between -cacerts and -clcerts when using openssl

Tags:

openssl

I'm trying to understand the difference between these two commands:

openssl pkcs12 -in my-certificate.pfx -out my-certificate.pem -cacerts

openssl pkcs12 -in my-certificate.pfx -out my-certificate.pem -clcerts

My understanding is that -cacert will just contain the root certificate while -clcerts will include the complete certificate chain. Is this correct?

I want to be able to extract the complete certificate chain from the pfx file, and Not sure if this is the right way to do it.

Thanks.

like image 242
mohsen Avatar asked Nov 07 '25 09:11

mohsen


2 Answers

according to the documentation,

-clcerts only output client certificates (not CA certificates).

-cacerts only output CA certificates (not client certificates).

https://www.openssl.org/docs/man1.0.2/man1/pkcs12.html

like image 147
osama yaccoub Avatar answered Nov 12 '25 09:11

osama yaccoub


To extract complete certificate chain from pfx file use:

openssl pkcs12 -in my-certificate.pfx -chain -nokeys -out my-certificate.pem

like image 33
Zwirek009 Avatar answered Nov 12 '25 08:11

Zwirek009



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!