How to add subjectAltName to certificate on the command line using OpenSSL

Use the following command line option to add a subjectAltName field to a certificate request.

-addext "subjectAltName=DNS:*.mydomain.com"