openssl req -new -x509 -batch -days 3650 -newkey rsa:2048 -nodes -subj /CN=host.domain.tld -keyout host.domain.tld.key.pem -out host.domain.tld.cer.pem
$ ./self_signed_mdcert.sh www.domain1.tld www.domain2.tld ...For a certificate based on an elliptic curve key, pass -ec as first parameter:
$ ./self_signed_mdcert.sh -ec www.domain1.tld www.domain2.tld ...