Run copy_cert_all.cgi from CLI

SYSTEM INFORMATION
OS type and version Rocky Linux 8.10
Webmin version 2.202
Virtualmin version 7.20.2
Webserver version Apache version 2.4.37
Related packages —

Hey folks,
I’m automating the provisioning of my infrastructure using Terraform and Ansible, and based on other posts I was able to get almost everything working. There is only one thing left, which is copying the SSL ceritificate issued on a virtualhost domain, to all the other services in webmin.
The script is copy_cert_all.cgi, which is the one that runs when we click the button “Set as Default Services Certificate”.
I looked at the docs for both CLI and virtualmin APIs and could not find an endpoint for it.
So I tried to run that script directly from the CLI but there must be some environment dependencies missing.
I tried to run:

WEBMIN_CONFIG=/etc/webmin REMOTE_USER=root QUERY_STRING="dom=17281367742002117" /usr/libexec/webmin/virtual-server/copy_cert_all.cgi

But got as a result:

Strict-Transport-Security: max-age=0;
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval'; frame-src 'self'; child-src 'self'
X-Content-Type-Options: nosniff
X-no-links: 1
Content-type: text/html; Charset=UTF-8

Undefined subroutine &WebminCore::fetch_content called at /usr/libexec/webmin/authentic-theme/authentic.pl line 48.

What would be a proper way to do this?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.