...the version that I've used is Win64OpenSSL-1_1_1t...
The two files differ in size. The p12-file that was downloaded directly in opnsense is ca. 20% bigger than the file that was generated with OpenSSL.
...under the attribute "Bag Attributes" there is the attribute "friendlyName:" that is missing in the openssl-file.
It is exactly as I said...
If a certificate contains an alias or keyid then this will be used for the corresponding friendlyName or localKeyID in the PKCS12 structure.
openssl pkcs12 -export -in certificate.crt -inkey certificate.key -name "friendlyName" -out certificate.p12
The WebGui-generated File has the two different certificates...
I had a problem with importing a self-signed certificate...
And I have proofed, that the two certificates are different. The first one is the https-certificate and the second one is the certificate for the intermediate CA. The first one has 2136 chars whereas the second one has 2198 chars. The attributes shows that the issuer for the first certificate is my Intermediate CA and for the second one for the "root CA", so they are for sure different.
openssl pkcs12 -info -nodes -in certificate.p12
Since I am only a beginner with the certificate-stuff it is not clear to me what I have to do with the -nokeys -cacerts-Option.
But what is not clear to me is what is the benefit of generating the P12-File in the WebGui with including the certificate for the Intermediate-CA. Does any szenario has a benefit of the second certificate?