tls refactor: server and client working
remove old tls code