Error when enabling SSL website on domain

I have one domain for which I'm trying to enable SSL. When I Edit Virtual Server and click the box for "Apache SSL website enabled?" and hit save, I get:

Creating SSL certificate and private key .. .. SSL website failed! : Failed to open /home/thedomain/ssl_certificates/cert.pem.webmintmp.6408 : No such file or directory at /usr/share/webmin/web-lib-funcs.pl line 1433, line 1.

I'm running Virtualmin 6.00, Webmin 1.851. I have several other domains running SSL fine (though none of them have a /home/domain/ssl_certificates directory).

I also note that the domain.conf.lock file remains in /etc/apache2/sites-available dir after trying to enable SSL.

FWIW, I'm using Let'sEncrypt certs for the other domains, and I don't recall having anything special to do other than enabling SSL and going through the Let'sEncrypt menus for getting a cert.

(I posted this in the forums too, but I'm under pressure to get this working for this domain, so copied here; apologies...)

Status: 
Active

Comments

Just tried adding SSL to another domain, and it was fine. Didn't create an ssl_certificates dir.

Howdy -- hmm, where was this particular domain configured to use the ssl_certificates dir?

That's not something that's normally used, we may need to look into how that's setup to ensure it'll work properly. Thanks!

I don't know how it got configured for ssl_certificates dir. Nothing that I know of doing.

I grep'd through /etc, and found the references in:

webmin/virtual-server/domains/138429387510080:ssl_key=/home/thedomain/ssl_certificates/privkey.pem (along with ssl_cert and ssl_chain)

I have no clue how that string got there. Not saying it wasn't something I did, but I definitely didn't edit those files.

How do I remove it? Is it safe to edit this file now? Seems like the safe thing would be to turn off SSL, but it's not shown as enabled in the Edit Virtual Server -> Enabled Features settings.

Further experimentation in trying to fix the problem:

I created /home/thedomain/ssl_certificates and tried turning on "Apache SSL website enabled". It created a cert.pem and a privkey.pem in that directory. So then I turned it off again, hoping it would remove the references from the /etc/webbin/virtual-server/domains/13xxx file, but nope -- still there.

You could try turning off SSL, removing those lines from /etc/webbin/virtual-server/domains/13xxx, and then turning SSL back on again. They will be re-generated using the default paths.

That worked! Thanks much, close ticket!

Eric.