There are several ways of obtaining an SSL certificate, all varying in degrees of ease of setup, security, and price.
The Easy Way - An easy, free method of obtaining a self-signed certificate. Not recommended for use on production machines.
The Hard Way - A harder way to obtain a self-signed certificate. Not recommended for production machines.
Let's Encrypt - A free method of obtaining an SSL certificate run by the Electronic Frontier Foundation.
Certificate Authority - While this method of obtaining a security certificate is not free, it is the most secure method of using an SSL certificate on a production server.