TLS connection implementetion