技术解析
根据官网教程 https://certbot.eff.org/lets-encrypt/ubuntuxenial-nginx 安装必须软件后
执行 $ sudo certbot --nginx
后报错:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
An unexpected error occurred:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 44: ordinal not in range(128)
Please see the logfiles in /var/log/letsencrypt for more details.
报错文件的内容是:
2018-03-17 13:06:34,407:DEBUG:certbot.main:certbot version: 0.21.1
2018-03-17 13:06:34,408:DEBUG:certbot.main:Arguments: []
2018-03-17 13:06:34,408:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#manual,PluginEntryPoint#nginx,PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot)
2018-03-17 13:06:34,417:DEBUG:certbot.log:Root logging level set at 20
2018-03-17 13:06:34,418:INFO:certbot.log:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2018-03-17 13:06:34,419:DEBUG:certbot.plugins.selection:Requested authenticator None and installer None
2018-03-17 13:06:34,731:DEBUG:certbot.log:Exiting abnormally:
Traceback (most recent call last):
File "/usr/bin/certbot", line 11, in
load_entry_point('certbot==0.21.1', 'console_scripts', 'certbot')()
File "/usr/lib/python3/dist-packages/certbot/main.py", line 1240, in main
return config.func(config, plugins)
File "/usr/lib/python3/dist-packages/certbot/main.py", line 1099, in certonly
installer, auth = plug_sel.choose_configurator_plugins(config, plugins, "certonly")
File "/usr/lib/python3/dist-packages/certbot/plugins/selection.py", line 194, in choose_configurator_plugins
authenticator = pick_authenticator(config, req_auth, plugins)
File "/usr/lib/python3/dist-packages/certbot/plugins/selection.py", line 40, in pick_authenticator
config, default, plugins, question, (interfaces.IAuthenticator,))
File "/usr/lib/python3/dist-packages/certbot/plugins/selection.py", line 77, in pick_plugin
verified.prepare()
File "/usr/lib/python3/dist-packages/certbot/plugins/disco.py", line 248, in prepare
return [plugin_ep.prepare() for plugin_ep in six.itervalues(self._plugins)]
File "/usr/lib/python3/dist-packages/certbot/plugins/disco.py", line 248, in
return [plugin_ep.prepare() for plugin_ep in six.itervalues(self._plugins)]
File "/usr/lib/python3/dist-packages/certbot/plugins/disco.py", line 130, in prepare
self._initialized.prepare()
File "/usr/lib/python3/dist-packages/certbot_nginx/configurator.py", line 131, in prepare
self.parser = parser.NginxParser(self.conf('server-root'))
File "/usr/lib/python3/dist-packages/certbot_nginx/parser.py", line 38, in __init__
self.load()
File "/usr/lib/python3/dist-packages/certbot_nginx/parser.py", line 45, in load
self._parse_recursively(self.config_root)
File "/usr/lib/python3/dist-packages/certbot_nginx/parser.py", line 66, in _parse_recursively
self._parse_recursively(subentry[1])
File "/usr/lib/python3/dist-packages/certbot_nginx/parser.py", line 56, in _parse_recursively
trees = self._parse_files(filepath)
File "/usr/lib/python3/dist-packages/certbot_nginx/parser.py", line 206, in _parse_files
parsed = nginxparser.load(_file)
File "/usr/lib/python3/dist-packages/certbot_nginx/nginxparser.py", line 123, in load
return loads(_file.read())
File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 44: ordinal not in range(128)
服务器是 ubuntu 16.04 nginx