add tlsConnect function