From cd52fc02b9be44c742c88c4c2117a887c2478188 Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Sun, 11 Oct 2015 11:20:21 -0700 Subject: [PATCH] Add a sleep to let Nginx finish reloading. --- letsencrypt-nginx/letsencrypt_nginx/configurator.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/letsencrypt-nginx/letsencrypt_nginx/configurator.py b/letsencrypt-nginx/letsencrypt_nginx/configurator.py index ffca041ca..426500eb3 100644 --- a/letsencrypt-nginx/letsencrypt_nginx/configurator.py +++ b/letsencrypt-nginx/letsencrypt_nginx/configurator.py @@ -6,6 +6,7 @@ import shutil import socket import subprocess import sys +import time import OpenSSL import zope.interface @@ -612,6 +613,10 @@ def nginx_restart(nginx_ctl, nginx_conf="/etc/nginx.conf"): except (OSError, ValueError): logger.fatal("Nginx Restart Failed - Please Check the Configuration") sys.exit(1) + # Nginx can take a moment to recognize a newly added TLS SNI servername, so sleep + # for a second. TODO: Check for expected servername and loop until it + # appears or return an error if looping too long. + time.sleep(1) return True