updated to be able to use ssl