moved ssl func