OPNsense Forum

Archive => 22.1 Legacy Series => Topic started by: DonSYS on March 30, 2022, 12:46:27 AM

Title: www/nginx: Mutiple Cert entries of the same cert
Post by: DonSYS on March 30, 2022, 12:46:27 AM
Hello,
I have the problem that under certificate field in NGINX plugin like HTTP Server or Upstream.
The dropdown of the certificate is listing the same certificates couple of times and also some deleted certificates are still in the list although they are deleted under ACME Client.
I tried to dig in the files but never figured out the way NGINX plugin is calling the certificates and how they're populated.
I think that the certs are being displayed there multiple of times due to the renewal that is being regarded as multiple certs.
I tried to clean up the directories  /usr/local/etc/nginx/key/ and  /var/etc/acme-client/ where old certs are still there but that didn't help that NGINX plugin stop displaying multiple certs.

Any tip how I did ended up with that and how can i clean up the multiple entries?
Title: Re: www/nginx: Mutiple Cert entries of the same cert
Post by: DonSYS on March 30, 2022, 03:11:45 AM
I ended up cleaning the doubled entries from https://fw01.lkd70.com:8443/system_certmanager.php
It would still be great if the entries there got overwritten when the same cert got renewed.
Title: Re: www/nginx: Mutiple Cert entries of the same cert
Post by: fabian on March 31, 2022, 01:08:48 PM
Nginx plugin does get the certificates from the OPNsense core and does not directly interact with the acme plugin unless that it can intercept acme calls to handle the challenges.
Title: Re: www/nginx: Mutiple Cert entries of the same cert
Post by: DonSYS on April 01, 2022, 02:41:29 AM
I figured this out later. But how does Nginx handle switching to the renewed certificate?
Given that NGINX will list all available certs from core including the renewed one.
Here Nginx will stick with the outdated cert, no?
Title: Re: www/nginx: Mutiple Cert entries of the same cert
Post by: fabian on April 01, 2022, 01:24:14 PM
The setup.php exports the selected certificates by ID. If you want to change it, you have to change the referenced record.