mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 02:54:34 +02:00
Use UTF-8 encoding for nginx plugin
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
"""NginxParser is a member object of the NginxConfigurator class."""
|
"""NginxParser is a member object of the NginxConfigurator class."""
|
||||||
import copy
|
import copy
|
||||||
|
import codecs
|
||||||
import functools
|
import functools
|
||||||
import glob
|
import glob
|
||||||
import logging
|
import logging
|
||||||
@@ -205,7 +206,7 @@ class NginxParser(object):
|
|||||||
if item in self.parsed and not override:
|
if item in self.parsed and not override:
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
with open(item) as _file:
|
with codecs.open(item, "r", "utf-8") as _file:
|
||||||
parsed = nginxparser.load(_file)
|
parsed = nginxparser.load(_file)
|
||||||
self.parsed[item] = parsed
|
self.parsed[item] = parsed
|
||||||
trees.append(parsed)
|
trees.append(parsed)
|
||||||
@@ -414,7 +415,7 @@ class NginxParser(object):
|
|||||||
def _parse_ssl_options(ssl_options):
|
def _parse_ssl_options(ssl_options):
|
||||||
if ssl_options is not None:
|
if ssl_options is not None:
|
||||||
try:
|
try:
|
||||||
with open(ssl_options) as _file:
|
with codecs.open(ssl_options, "r", "utf-8") as _file:
|
||||||
return nginxparser.load(_file)
|
return nginxparser.load(_file)
|
||||||
except IOError:
|
except IOError:
|
||||||
logger.warning("Missing NGINX TLS options file: %s", ssl_options)
|
logger.warning("Missing NGINX TLS options file: %s", ssl_options)
|
||||||
|
|||||||
Reference in New Issue
Block a user