virtualmin / virtualmin-gpl

Virtualmin web hosting control panel for Webmin
https://www.virtualmin.com
GNU General Public License v3.0
308 stars 95 forks source link

SSL certificates aren't restored if Apache feature is disabled #857

Open iliajie opened 1 month ago

iliajie commented 1 month ago

Hello Jamie.

Do we expect SSL certificates for the domain to be backed up and later restored on the destination system when a domain on the source system doesn't have the Apache website enabled feature turned on?

The source system had the Apache website enabled feature disabled, and it had SSL certificates used for Dovecot, Postfix, Webmin, and other services. Yet, after backing up the domain and restoring it on another system with Apache, the SSL certificates were not restored.

On the positive side, it didn't recreate those records in those services with missing files in them.

I think it's a bug. Even though we don't break anything, the restore process changes things, which isn't something a user might expect.

jcameron commented 1 month ago

Yes, this looks like a bug - I'll work on fixing it for a future release.

iliajie commented 1 month ago

I have applied all the latest patches, but it has started to fail now:

image
jcameron commented 1 month ago

Oops I forgot to create the SSL dirs - just checked in a fix for that.

iliajie commented 1 month ago

Thanks, Jamie! That seems to work now!

However, another issue has come up. The SSL certificates appear to be in place, but Virtualmin is still complaining and showing an extra button:

image

.. when clicked:

image

Afterwards, the button disappeared when returned to SSL Certificates page.

It seems that ssl.cert was missing in the first place. Evidently another bug!

jcameron commented 1 month ago

So even after restoring the domain, was ssl.cert missing from that path?

If so, can you check of it was included in the backup file?

iliajie commented 3 weeks ago

So even after restoring the domain, was ssl.cert missing from that path?

Yes, but I fixed it later.

The other problem I see is when a virtual server is created with the website feature disabled. It doesn't seem to create a self-signed SSL certificate at all.

For example:

image image image

This issue happens despite SSL certificate sharing.

No SSL certificate files are created in /etc/ssl/virtualmin either.

jcameron commented 3 weeks ago

That's kind of expected - users can choose to create an SSL cert if needed, but the assumption is that if the domain has no website it's unlikely than an SSL cert will be needed.

iliajie commented 3 weeks ago

But the mail feature is enabled?

jcameron commented 3 weeks ago

I suppose we could add an option to always request / generate a cert..

iliajie commented 3 weeks ago

Yes, but in this case only if DNS is controlled by Virtualmin.