adding config handling and first shot at TLS support for production