how to create letsencrypt (Let's encrypt) certificate for alias

Well it is pretty easy to create SSL certificate for virtual server with letsencrypt.
The problem occurs when there is an alias, because it uses main domain certificate, which is single domain certificate.

Any ideas?

OK, I found it. With the newest virtualmin version there is posibility to generate letsencrypt certificate for “Domain names listed here”. So you just choose that option and enter domain for main server and subservers or/and aliases. Then the right certificate will generate. Tested and works like a charm:-)