typos
some refactoring of openssl stuff
Merge pull request #1400 from Blackmist/self-signed-ssl

Self signed ssl