Create SSL certificate for https use on localhost

Asked

Viewed 12,110 times

2

I tried some tutorials on the internet to enable https on my localhost and so far I could not do it right, it seems that something is broken, because it appears as a page not safe and the acronym "https://" scratched in red, but if I force it works; The terminal also keeps asking for a password every time I imagine to be from the certificate. What I wanted to do is redo everything right, clean up what I did before and learn step by step, if anyone can help me, I’m grateful.

I am using linux/ubuntu16.10

  • You have created or are purchasing this certificate?

  • I want to create for local use

  • 1

    Friend, I usually follow this tutorial [https://servidordebian.org/pt/jessie/intranet/ssl_cert/start]. You can help yourself.

  • Thanks @Isaquefernando I think it will help yes!

  • The case was solved with this tutorial: https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-apache-for-ubuntu-14-04

  • 1

    @Talesbreno would be nice to explain better in your reply how it was solved (not only with the link) because the way it was, just a comment and not a link as a response. If you would be so kind as to explain at least the essential steps, it’s nice for other visitors with the same problem.

  • The case was solved with the tutorial I indicated in the reply... Thanks ;)

Show 2 more comments

2 answers

3

Apparently you’re not doing anything wrong. The fault indicating that the page is not secure appears because the certificate is self-signed (created by you). Read here a clarification on this. As you see, it is possible to say to the Firefox that the certificate, although self-signed, is reliable. But the message at all times will appear unless you purchase a certificate signed by a trusted certification institution (more details).

In short, to use certificate created by yourself, you will always have to "force" the browser to trust it.

To generate certificate without password (assuming you use openssl), just pass the option -nodes in the creation command, something like this: openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout local_da_key/nome.key -out local_do_certificado/nome.crt

That information came from here, and in free translation, it’s more or less that:

-nodes: This option informs Openssl that we do not want to protect our key file with a password. Having a password-protected key file would disrupt automatic Apache startup, as we would have to enter the password every time the service was restarted.

I believe that the step by step tutorial I indicated is very good to learn the basics.

If you have a public domain registered to want free certification, it is worth knowing https://letsencrypt.org/, which together with https://certbot.eff.org/ are an excellent tool (See a tutorial for Apache here).

1

I was making the same mistake and what you solved for me was:

1 - Clean up the cache browser (Ctrl+alt+del).

2 - Place the door at url, ex.: https://localhost:443/project...

Note: I do not know if it solves in all cases, in mine I followed this tutorial here (https://academiawordpress.com.br/usando-https-no-localhost/) for installation of the certificate in Windows.

I hope it helps!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.