The certificate you have generate is "self-signed" and that's why you obtain that error. If you add the URL as an exception you will be able to access to your site via https.
If you want to avoid that error message you need to buy it at a certificate authority (CA). You can also use Let's Encrypt to generate a Certificate which must be renewed every 90 days. You can install Let's Encrypt following this guide and generate and install the certificate obtained with Let's Encrypt following this one.
I hope this information is useful for you. If you have any other question, please do not hesitate to let us know.