Implemented tls server support.
Added advanced tls listen function.
Removed duplicated code.
Cleanups.
Make sure sha512 is supported.
Fixed comment.
Merge pull request #2 from longsleep/https

Implemented tls server support.