From b5fa0fbad758ce4680631599de12557f602692cf Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Mon, 8 Aug 2016 18:08:11 -0700 Subject: [PATCH] This is reportedly the correct magic --- certbot-nginx/certbot_nginx/configurator.py | 2 +- certbot-nginx/certbot_nginx/parser.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/certbot-nginx/certbot_nginx/configurator.py b/certbot-nginx/certbot_nginx/configurator.py index afa8b8087..5e415bce6 100644 --- a/certbot-nginx/certbot_nginx/configurator.py +++ b/certbot-nginx/certbot_nginx/configurator.py @@ -341,7 +341,7 @@ class NginxConfigurator(common.Plugin): options_subblock = self.parser.loc["ssl_options"] # the options file doesn't have a newline at the beginning, but there # needs to be one when it's dropped into the file - if "\n" not in options_subblock[0]: + if options_subblock and "\n" not in options_subblock[0]: options_subblock[0].insert(0, "\n") ssl_block = ( [['\n ', 'listen', ' ', '{0} ssl'.format(self.config.tls_sni_01_port)], diff --git a/certbot-nginx/certbot_nginx/parser.py b/certbot-nginx/certbot_nginx/parser.py index cf1f3c1db..73224ea1f 100644 --- a/certbot-nginx/certbot_nginx/parser.py +++ b/certbot-nginx/certbot_nginx/parser.py @@ -179,7 +179,7 @@ class NginxParser(object): with open(ssl_options) as _file: return nginxparser.load(_file).spaced except IOError: - logger.debug("Could not open file: %s", ssl_options) + logger.warn("Missing NGINX TLS options file: %s", ssl_options) except pyparsing.ParseException: logger.debug("Could not parse file: %s", ssl_options) return []