add TLS support and upstart configure