Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
Development and Code Review
(Moderator:
fabian
) »
[SOLVED] Unable to update certificate with ACME Client API
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] Unable to update certificate with ACME Client API (Read 1853 times)
cmdrwalrus
Newbie
Posts: 2
Karma: 0
[SOLVED] Unable to update certificate with ACME Client API
«
on:
May 04, 2023, 02:56:31 am »
Hello!
I've been trying to update a certificate in ACME Client via the API, to add more altNames. I've been successful with /add and /get, but when I try to use /set it says '{"result":"saved"}' but nothing is changed in the record.
I've attached my script, if anyone can take a look at it and see if I'm missing something.
Thanks!
Chad.
«
Last Edit: May 05, 2023, 01:23:38 am by cmdrwalrus
»
Logged
cmdrwalrus
Newbie
Posts: 2
Karma: 0
[Solved] Re: Unable to update certificate with ACME Client API
«
Reply #1 on:
May 04, 2023, 11:47:02 pm »
OK, I figured it out!
I looked at the source code [1] for the ACME Client plugin and noticed the set method is called 'updateAction'. So I changed my POST to use /api/acmeclient/certificates/update/<uuid>, and removed the spaces from the CSV value for altNames, and it works now!
I've attached the working version of my script in case it helps anyone.
1.
https://github.com/opnsense/plugins/blob/master/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
Development and Code Review
(Moderator:
fabian
) »
[SOLVED] Unable to update certificate with ACME Client API