I obtained a free CA certificate from https://www.startssl.com/.
I added the domain name
example.com, and in the control panel, it shows
www.example.com under SSL/TLS Server, and
example.com under Domain Validations.
I configured Apache (running on Centos) per the instructions, and can access https://example.com/ without a “Untrusted Connection” warning, but when accessing https://www.example.com/, I get the warning.
You were meant to obtain an SSL certificate for
When you do this, StartSSL will give you a certificate that works for both hostnames.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.