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 []