https - connection not private, https://www - all ok

#1
Hi,

Sorry if same question already asked many times.

I have web-server OpenLiteSpeed 1.4.50. SSL certificate from Let's Encrypt.

Virtual Host Example > Rewrite > Rewrite Rule
Code:
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Redirect from http://example.com, http://www.example.com, www.example.com to https://www.example.com work fine and browser shows SSL is good. But when I type https://example.com it shows - connection not private. I have no idea why? Why SSL works for https://www.example.com not work for https://example.com. What setting should i check?
 
#3
Can you set the certificate tu support both......
I'm sorry, but how?
I think it is only one path for each certificate in Listener Defaultssl > SSL > SSL Private Key & Certificate

Yes, I have for https:// - Certificate name mismatch. How to set certificate to support www.example.com and example.com ?

Update:
I fixed it with
Code:
certbot -d www.example.com -d example.com
Threre were two unconnected/independent SSL certificate, one for www.example.com, second for example.com. When I tried connect to https://example.com, browser shows error - "Certificate name mismatch, because it issued for www.example.com". This certbot command above extend/connect these two certificate and it works for https://example.com and www. and etc. I hope I did everything right :)
 
Last edited:
Top