<?xml version="1.0"?><opnsense> <version>11.2</version> . <cert> <refid>a1b2c3d4e5f6</refid> <descr>Text Description</desc> <crt>[Very long continuous string of the public key of this certificate]</crt> <prv>[Very long continuous string of the private key of this certificate]</prv> </cert>
<?xml version="1.0"?><opnsense> <version>11.2</version> . <cert> . </cert> . <system> . <webgui> <protocol>https</protocol> <ssl-certref>6045008dd0e08</ssl-certref> <port>8443</port> <ssl-ciphers/> <interfaces/> <compression>5</compression> . . <webgui> . </system>
Hi DenverTechI had a similar situation in the middle of March (2023) - I was running V23.1_6 at the time. Whilst running V23.1_6 my Acme.sh had run successfully because a certificate update was needed. I didn't bother looking at the certificate details, until I noticed that my browsers (I tried different browsers on different machines too) were all telling me that there was a certificate problem. I looked at the certificate and sure enough it had expired. I spent a few hours digging to try and understand how certificates are stored and referenced in OPNsense. What follows is a summary of how certificates are stored, what caused the problem in my system, and how I fixed it.All certiificates are stored in the config file ( /conf/config.xml ) in a structure that looks like the box below. "<cert>" is at level 2 (with "<opnsense>" at level 1 (top)). There is a separate "<cert>" section for each certificate. The "<refid>" item is unique for every certificate, and is used to select a required certificate.Code: [Select]<?xml version="1.0"?><opnsense> <version>11.2</version> . <cert> <refid>a1b2c3d4e5f6</refid> <descr>Text Description</desc> <crt>[Very long continuous string of the public key of this certificate]</crt> <prv>[Very long continuous string of the private key of this certificate]</prv> </cert>Now in another level 2 section denoted by "<system>", there exists a level 3 section denoted by "<webgui>". See the next box for its structure:Code: [Select]<?xml version="1.0"?><opnsense> <version>11.2</version> . <cert> . </cert> . <system> . <webgui> <protocol>https</protocol> <ssl-certref>6045008dd0e08</ssl-certref> <port>8443</port> <ssl-ciphers/> <interfaces/> <compression>5</compression> . . <webgui> . </system>The item "<ssl-certref>" contains the 12-digit identifier for the certificate that is to be used for the web server. In my system which was still serving the out-of-date certificate, the identifier (pointer) contained in the "<ssl-certref>" parameter was actually the id for the old certificate, not the new certificate that had been acquired by acme.sh. That explained why the certificate being served by the web server, was out of date.Fixing the problemI made a backup copy of the config.xml fileI located the new acme.sh acquired certificate in its <cert>..</cert> block and noted its refidI edited the config file and updated the certificate reference in the "<ssl-certref>" section with the correct id from step 2Rebooted the systemThat fixed the problem for me. What I didn't do was locate the code that updates the <webgui> section after acme.sh has run and try to come up with an hypothesis as to why it wasn't updated correctly when acme.sh ran successfully.I'll keep an eye on it the next time acme.ssh runs to see if it happens again.An AsideHaving fixed the certificate pointer, I went and looked at the certificates from the GUI (System -> Trust -> Certificates ).I then noticed that the entry for the old (out-of-date) certificate for (ACME Client) now had a little waste bin icon at the end of the line, indicating that it could be deleted. When I had started my investigation I had noted that there was no waste bin icon for the old certificate.HTH with your problemPeterF
Ok...got a fix, but no idea why/how it broke in the first place.