I am able to update the certificate in place using the APIs as indicated above. I cannot get opnsense to use the updated certificate, however. I have tried issuing an API call to restart the webgui and I have tried calling reconfigure in the trust section. None of these force opnsense to use the new certificate.
These are the API calls I have tried:
POST /api/core/service/restart/webgui
POST /api/trust/settings/reconfigure
EDIT: I did some more investigation and testing and the GUI uses /api/core/service/restart/webgui, but it uses the web sessionid for authentication. When I call it using the API token, I receive an error - curl: (16) Error in the HTTP2 framing layer. It doesn't seem like I can trigger a webgui restart using the API from my script. As a workaround, I am now executing 'configctl webgui restart' from my script using SSH. This works, but it is not as clean.
These are the API calls I have tried:
POST /api/core/service/restart/webgui
POST /api/trust/settings/reconfigure
EDIT: I did some more investigation and testing and the GUI uses /api/core/service/restart/webgui, but it uses the web sessionid for authentication. When I call it using the API token, I receive an error - curl: (16) Error in the HTTP2 framing layer. It doesn't seem like I can trigger a webgui restart using the API from my script. As a workaround, I am now executing 'configctl webgui restart' from my script using SSH. This works, but it is not as clean.
"