Letsencrypt certificates should include alias and subservers

Today I tried to make a letsencrypt SSL certificate with the new release of virtualmin. It’s pretty easy and worked very well. But, what I found out was, that the certificate does not include alias and subservers of a server. Also, WWW.domain.tld is not included in the certificate. Will this be fixed, is there any workaround?

I join the questions. Unfortunately there is no information and instructions for letscrypt + webmin + virtualmin + usermin. Will the certificate be renewed automatically? A great new feature, but how can we use it effectively …

Hi guys,

After some research I have found a way to achieve both www.domain.com and domain.com included in letsencrypt requested certificate.
I changed following line in /usr/libexec/webmin/webmin/letsencrypt-lib.pl:

my $out = &backquote_command("cd $dir && (echo A | $letsencrypt_cmd certonly -a webroot “.join(” ", map { “-d “.quotemeta($_) } @doms).” --webroot-path “.quotemeta(webroot).” --duplicate --config $temp 2>&1)”);


my $out = &backquote_command("cd $dir && (echo A | $letsencrypt_cmd certonly -a webroot -d www.$dom ".join(" ", map { "-d ".quotemeta($_) } @doms)." --webroot-path ".quotemeta(webroot)." --duplicate --config $temp 2>&1)");

It worked like a charm for me. If there is more elegant way to achieve this, please share.

Dean Iliev

Thank you for this solution, but there is 1 typo in your line.

my $out = &backquote_command("cd $dir && (echo A | $letsencrypt_cmd certonly -a webroot -d www.$dom ".join(" ", map { "-d ".quotemeta($_) } @doms)." --webroot-path ".quotemeta($webroot)." --duplicate --config $temp 2>&1)");

(Notice the $ before webroot in .quotemeta($webroot) )

In a new version of virtualmin you can generate letsencrypt certificate for any domains you want. There is an option “Domain names listed here”. You do this at the main virtualserver level and you enter all aliases you have. Then certificate is generated for all listed domains.