The goal is to have free ssl from cloudflare. So I moved dns records to cloudflare and is showing me - Certificate is Active. When I go to ‘Analytics tab’ it shows me traffic that is coming to the website. But when I enter the site https://www.zampadebattista.com I’m getting ‘Your connection is not private’. It look that virtualmin is using his own self-signed certificate that I didn’t setup. Do I need change something in virtualmin?
The issue you’re experiencing occurs because your server is presenting its self-signed certificate rather than the Cloudflare-issued certificate. To resolve this and ensure that your site works with Cloudflare’s SSL, follow these steps:
Step 1: Verify Cloudflare SSL Mode
Cloudflare offers several SSL modes. Set the appropriate mode for your setup:
Log in to Cloudflare and go to your domain’s SSL/TLS settings.
Ensure the SSL mode is set to Full or Full (Strict):
Full: Requires a valid SSL certificate (self-signed is acceptable) on your server.
Full (Strict): Requires a valid and trusted SSL certificate on your server.
Step 2: Update Virtualmin SSL Settings
You need to configure Virtualmin to work with Cloudflare SSL.
A. Disable the Self-Signed Certificate
Log in to Virtualmin.
Navigate to Server Configuration > SSL Certificate.
Under the Current Certificate tab, confirm the presence of the self-signed certificate.
If you don’t need the self-signed certificate, delete it by clicking the Delete Certificate button.
B. Use Cloudflare’s Origin Certificate (Optional)
If you want tighter security, you can generate a Cloudflare Origin Certificate to install on your server. Here’s how:
In Cloudflare, go to SSL/TLS > Origin Server.
Click Create Certificate and select a 15-year certificate.
Download the certificate and private key.
Upload these to Virtualmin:
Go to Server Configuration > SSL Certificate.
Under the Upload Certificate tab, upload the certificate and private key files from Cloudflare.
Save the changes.
Step 3: Redirect All Traffic to HTTPS
Ensure all traffic is redirected to HTTPS by adding a redirect rule:
A. Using .htaccess (for Apache)
If your website uses .htaccess:
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]