added setSocket method to hide difference TLS is used or not
ssl wrap is applied