use tls if environment variable is set