This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: nick2253 on June 26, 2025, 02:21:30 AMI created a feature request and a pull request:
https://github.com/opnsense/plugins/issues/4773
https://github.com/opnsense/plugins/pull/4774
Quote from: nick2253 on June 25, 2025, 07:23:43 PMI noticed something similar. I wish I would have documented it, but I failed to do so.
Quote from: Schnuffel2008 on May 29, 2023, 11:30:43 PMThe -nokeys -nocerts parameters would create the PKCS#12 archive without the private key and server certificate. Only the CA certificate(s) would be included depending on whether you use -certfile cert.pem or -certfile cert2.pem (presuming your Intermediate CA cert was cert2.pem and not cert1.pem). You could then attempt to import them into the switch. This was to check if the switch accepts CA certificates without them being an extra certificate(s). We know it accepts server certificates, but what about CA certificates. I note this may not be a valid test anyway, depending on how Zyxel have chosen to process the bag. An alternative would be to export the Intermediate CA certificate in the GUI as a PKCS#12 archive and see if that can be imported. Does that make sense now?
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.
Quote from: Schnuffel2008 on May 29, 2023, 11:30:43 PMAccording to the relevant RFC, when setting up the HTTPS connection, a server (in this case your switch) is required to include all intermediate CA certificates in the certificate_list of the Server Certificate Message. The exception is the root CA certificate, which MAY be omitted from the chain specified in the certificate_list.
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?
Quote from: Schnuffel2008 on May 18, 2023, 08:19:54 AM
I had a problem with importing a self-signed certificate...
Quote from: Schnuffel2008 on May 28, 2023, 11:05:33 AM
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
Quote from: Schnuffel2008 on May 25, 2023, 09:02:42 PMRight, thanks for confirming that.
It is exactly as I said...
QuoteIf a certificate contains an alias or keyid then this will be used for the corresponding friendlyName or localKeyID in the PKCS12 structure.So in our case, when no friendly_name is specified, the PHP uses NULL and the OpenSSL function then uses the certificate alias for the friendlyName Bag attribute. Mystery solved..!
openssl pkcs12 -export -in certificate.crt -inkey certificate.key -name "friendlyName" -out certificate.p12
Quote from: Schnuffel2008 on May 25, 2023, 09:02:42 PMCan you also please confirm the two certificates in the WebGUI-generated archive are indeed different? I expected them to be the same as it is self-signed. It could be argued that including a self-signed certificate as a CA certificate is a bug.
The WebGui-generated File has the two different certificates...
Quote from: Schnuffel2008 on May 23, 2023, 07:58:12 PMAre you sure the friendlyName was missing in the manually generated file? I would expect it to be missing in the OPNsense generated file instead.
...under the attribute "Bag Attributes" there is the attribute "friendlyName:" that is missing in the openssl-file.
Quote from: franco on May 25, 2023, 11:42:32 AM
Sorry, that happens sometimes. :)
Quote from: Schnuffel2008 on May 18, 2023, 08:19:54 AM
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.