I created own Certificate Authority and server (virtualhost) certificate based on this specification: https://jamielinux.com/docs/openssl-certificate-authority/index.html
It's successfully created, it works, but server-certificate not working without "www" prefix.
If I load domain without "www", get an error:
SSL_ERROR_BAD_CERT_DOMAIN
I checked several pages longer, option would have (SAN - Subject Alternative Names), just do not know how to insert the above configuration.
Your SSL certificate is only valid for www.example.com. If you wish to access example.com you have the following option :
Note : You can't use wildcard certificate to achieve this because there is nothing in front of example.com (it would work for xyz.example.com).
I add this line to intermediate CA config file:
in 'server_cert' section:
subjectAltName = @dns_names
and add a new section:
And my problem is solved!