Move global variables to https client