Is there a modern and clear tutorial on setting up SSL for localhost / testing use?

At least on Ubuntu 12.10, it's crazy simple now.

sudo a2ensite default-ssl && sudo a2enmod ssl && sudo service apache2 restart

That's all.

Try it:

  • http:// localhost
  • https:// localhost (I can't link these due to restrictions.)
  • Try also with a custom domain (point anything at 127.0.0.1, like https://example.com, via /etc/hosts)

The command spits out a readme file, but it's not really necessary.

Note: It's expected to get a cautionary message from the browser when accessing since it's a self-signed certificate.

PS: This assumes a normal and fresh-enough install the LAMP stack via tasksel install lamp-server