I'm setting up Let's Encrypt to issue certificates automatically. Each user will have their own subdomain so I need to create certificates in batch every so many hours to avoid LE's rate limits.
Between the time they sign up and the time their certificate is ready I want to serve their subdomain over HTTP. As long as the certificate exists, the action should be to always redirect HTTP to HTTPS. Bonus if we can check the validity of the certificate. Suggestions?