Hi fabian,
Seems to work to upload certificates (using your example although using python) - but this won't work for switching the certificates as system_advanced_admin.php is too heavily dependent on executed javascript to change the form to the correct values :( CSRF was only a small walk in the park, but the actual changing of the certificate won't work unfortunately.
I can scrape enough to change to the correct certificate but this isn't a viable solution in any form of way - mostly due to the form's defaults (without javascript) being too empty. Maybe I should look closer into https://github.com/opnsense/plugins/blob/master/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php and figure out how to re-use the code from line 987 (Update certificate object) to select the uploaded cert & following restart actions.
If someone has some pointers I'd be very happy to dig further into this, otherwise we'll just schedule some human-minion-working-hours ever so often, but I'd really like to avoid that :)
Kind regards,
Tom
Seems to work to upload certificates (using your example although using python) - but this won't work for switching the certificates as system_advanced_admin.php is too heavily dependent on executed javascript to change the form to the correct values :( CSRF was only a small walk in the park, but the actual changing of the certificate won't work unfortunately.
I can scrape enough to change to the correct certificate but this isn't a viable solution in any form of way - mostly due to the form's defaults (without javascript) being too empty. Maybe I should look closer into https://github.com/opnsense/plugins/blob/master/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php and figure out how to re-use the code from line 987 (Update certificate object) to select the uploaded cert & following restart actions.
If someone has some pointers I'd be very happy to dig further into this, otherwise we'll just schedule some human-minion-working-hours ever so often, but I'd really like to avoid that :)
Kind regards,
Tom