Start obtaining Let's Encrypt's certificates for pages immediately after user activate it in the UI

Problem to solve

Currently, we check for new domains requiring obtaining new SSL certificates/renewing them once in 15 minutes. Process of obtaining certificates takes about 2.5 minutes.

That result in median time about 9 minutes for obtaining the first LE certificate for domain.

Extracted from https://gitlab.com/gitlab-org/gitlab-ce/issues/64432

Proposed solution

We can start obtaining LE certificate immediately after user saved domain settings. That will reduce the waiting time by about 8 minutes.

Side note: I wouldn't make a period for the cron worker bigger than 15 minutes even after implementing this because LE certificates would be obtained until the user verifies the domain.

Edited by Vladimir Shushlin