TLS improvements and heartbeat support
turn off heartbeats until tested thoroughly