MDL-42834 Authentication: Fix loginhttps-related unit tests and add upgrade behaviour