I tried to generate a SSL certificate with Let's Encrypt on my EC2 instance with an elastic IP associated to it.
The command I run is
./letsencrypt-auto certonly --standalone -d mariellaval.com -d www.mariellaval.com
Browsing https://mariellaval.com the connection is private, but browsing https://www.mariellaval.com it isn't because the Common Name of the certificate is the DNS of the elastic IP. Why?. What am I doing wrong?
UPDATE
This is my virtual host file:
<VirtualHost _default_:443>
ServerName mariellaval.com:443
ServerAlias www.mariellaval.com:443
DocumentRoot /var/www/path/to/public
SSLEngine on
SSLCertificateFile path/to/cert.pem
SSLCertificateKeyFile path/to/privkey.pem
SSLProtocol all -SSLv2 -SSLv3
SSlCipherSuite ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA;
SSLHonorCipherOrder on
<Directory /var/www/path/to/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
In the .htaccess i force the www, but I temporary disabled it to figure out the certificate problem.