Use 3rd party ssl wildcard cert automatically for sub-servers

SYSTEM INFORMATION
OS type and version Redhat Enterprise Linux 8.8
Webmin version 2.101
Usermin version 2.001
Virtualmin version 7.8.2
Theme version 21.04
Package updates 26 package updates are available, of which 3 are security updates

I want to use a commercial cert I already have for sub-servers under a virtual server – our development group has a three part domain assigned to them – wphost01.anywhere.com – and for their DEV work, they create four part names such as verne.wphost01.anywhere.com. So I want to automatically configure and use the existing cert *.wphost01.anywhere.com.

One thing I tried but failed, plus is very crude and ugly — placed the commercial cert/key/chain files in a directory (such as /etc/pki/tls/xxxxx/) and then made all three files immutable with chattr +i xxxxx. Then made a custom Sub-Server Template, and in that template, on the SSL Website pulldown panel, manually entered my full path and filename for the key/cert/CA cert (aka chain) into each of the Custom Path fields. This does create a new self-signed cert in the specified files, overwriting the commercial cert, unless I have the immutable bit set, as the immutable bit stops Virtualmin from being able to write/update those files – but see below.

I thought the immutable trick would work, but the Apache SSL website module (?) fails during the sub-server creation as it can’t create the self-signed cert; the failure does display an error message and then causes the entire ssl apache stanza to not be created (rightfully so I suppose) – note the port 80 stanza does get created.

Before I start hacking away at php code, I wanted to get input in case I have missed something :smile:

And this could be such a one-off usage case (plus how would I describe it) that I hesitate to submit it as an enhancement request or blue sky post.

I think I may have found something. First I create a placeholder sub-server and manually upload my commercial wildcard cert via the Setup SSL Cert panel.

Then later when creating another sub-server, I think the subroutine find_matching_certificate will ‘find’ the existing wildcard, and use it for the new sub-server.

I will do some more testing but this seems very promising – of course I cannot delete the ‘placeholder’ sub-server :smile:

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