Generate a self-signed cert when none is provided

The documentation suggested doing this manually, but this is better because it does it for you!
I stripped out everything that wasn't needed to generate a self-signed cert.