Added option to use ssl