Https Error

I recently changed my Http website to Https with the following code:
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

In the /htdocs/.htaccess directory.

But always this message appears when i try to join the website:
This website isn’t safe, other warning messages and this is the error:

I just wanted to know if this is the error of the hosting of my browsers, and a solution because many others trying to log onto my website experience this.

Yours faithfully,

The error shows that the .htaccess code works: you are being redirect to the SSL version of your site.

However, by default all websites are issued with a self signed certificate. A self signed SSL certificate does encrypt the connection between the browser and the server, but the certificate is not trusted. That’s why you see this error.

To get a proper green lock, you’ll have to install your own, valid SSL certificate.

How do I do that? Can I get some more information and help

Thanks for the fast reply.

If you would like to have a free SSL certificate, you can choose to activate CloudFlare service via the cPanel. You may also use Let’s Encrypt’s SSL.