(Http-01): urn: ietf: params: acme: error: несанкционированная ошибка при выполнении команды $ sudo certbot Renew --dry-run

среда ・ Nginx ・ CentOS 7 ・ Certbot 0.31.0


$ sudo certbot обновить --dry-run


Saving debug log to /var/log/letsencrypt/letsencrypt.log


Processing /etc/letsencrypt/renewal/hoge.example.com.conf

Cert not due for renewal, but simulating renewal for dry run
Plugins selected: Authenticator nginx, Installer nginx
Starting new HTTPS connection (1): acme-staging-v02.api.letsencrypt.org
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for hoge.example.com
Waiting for verification...
Cleaning up challenges
Attempting to renew cert (hoge.example.com) from /etc/letsencrypt/renewal/hoge.example.com.conf produced an unexpected error: Failed authorization procedure. hoge.example.com (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from https://hoge.example.com/.well-known/acme-challenge/xxxx [IP address]: "<!doctype html>\r\n<html lang=\"ja\">\r\n<head>\r\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\r\n\t<meta http-e". Skipping.

Вопрос

・ Что именно означает процедура неудачной авторизации?

・ Содержимое ошибки обрезается при пропуске. Что мне делать, чтобы отобразить их все?


2019/4/16 добавить

$ sudo меньше /var/log/letsencrypt/letsencrypt.log

2019-04-16 20:40:54,333:DEBUG:certbot.updater:Skipping renewal deployer in dry-run mode.
2019-04-16 20:40:55,401:DEBUG:certbot.updater:Skipping updaters in dry-run mode.
2019-04-16 20:40:55,455:DEBUG:certbot.cli:Var dry_run=True (set by user).
2019-04-16 20:40:55,455:DEBUG:certbot.cli:Var server=set(['staging', 'dry_run']) (set by user).
2019-04-16 20:40:55,456:DEBUG:certbot.cli:Var dry_run=True (set by user).
2019-04-16 20:40:55,456:DEBUG:certbot.cli:Var server=set(['staging', 'dry_run']) (set by user).
2019-04-16 20:40:55,456:DEBUG:certbot.cli:Var account=set(['server']) (set by user).
2019-04-16 20:40:55,482:DEBUG:certbot.storage:Should renew, less than 30 days before certificate expiry 2019-05-01 22:55:56 UTC.
2019-04-16 20:40:55,482:INFO:certbot.renewal:Cert is due for renewal, auto-renewing...
2019-04-16 20:40:55,482:DEBUG:certbot.plugins.selection:Requested authenticator manual and installer None
2019-04-16 20:40:55,483:DEBUG:certbot.plugins.disco:Other error:(PluginEntryPoint#manual): An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/certbot/plugins/disco.py", line 132, in prepare
    self._initialized.prepare()
  File "/usr/lib/python2.7/site-packages/certbot/plugins/manual.py", line 133, in prepare
    self.option_name('auth-hook')))
PluginError: An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.
2019-04-16 20:40:55,516:DEBUG:certbot.plugins.selection:No candidate plugin
2019-04-16 20:40:55,516:DEBUG:certbot.plugins.selection:Selected authenticator None and installer None
2019-04-16 20:40:55,516:INFO:certbot.main:Could not choose appropriate plugin: The manual plugin is not working; there may be problems with your existing configuration.
The error was: PluginError('An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.',)
2019-04-16 20:40:55,520:WARNING:certbot.renewal:Attempting to renew cert (example.com) from /etc/letsencrypt/renewal/example.com.conf produced an unexpected error: The manual plugin is not working; there may be problems with your existing configuration.
The error was: PluginError('An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.',). Skipping.
2019-04-16 20:40:55,527:DEBUG:certbot.renewal:Traceback was:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/certbot/renewal.py", line 452, in handle_renewal_request
    main.renew_cert(lineage_config, plugins, renewal_candidate)
  File "/usr/lib/python2.7/site-packages/certbot/main.py", line 1187, in renew_cert
    installer, auth = plug_sel.choose_configurator_plugins(config, plugins, "certonly")
  File "/usr/lib/python2.7/site-packages/certbot/plugins/selection.py", line 237, in choose_configurator_plugins
    diagnose_configurator_problem("authenticator", req_auth, plugins)
  File "/usr/lib/python2.7/site-packages/certbot/plugins/selection.py", line 341, in diagnose_configurator_problem
    raise errors.PluginSelectionError(msg)
PluginSelectionError: The manual plugin is not working; there may be problems with your existing configuration.
The error was: PluginError('An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.',)

2019-04-16 20:40:55,527:ERROR:certbot.renewal:The following certs could not be renewed:
2019-04-16 20:40:55,527:ERROR:certbot.renewal:  /etc/letsencrypt/live/entrepreneur.0mode.tokyo/fullchain.pem (failure)
  /etc/letsencrypt/live/example.com/fullchain.pem (failure)
2019-04-16 20:40:55,528:DEBUG:certbot.log:Exiting abnormally:
Traceback (most recent call last):
  File "/usr/bin/certbot", line 9, in <module>
    load_entry_point('certbot==0.31.0', 'console_scripts', 'certbot')()
  File "/usr/lib/python2.7/site-packages/certbot/main.py", line 1365, in main
    return config.func(config, plugins)
  File "/usr/lib/python2.7/site-packages/certbot/main.py", line 1272, in renew
    renewal.handle_renewal_request(config)
  File "/usr/lib/python2.7/site-packages/certbot/renewal.py", line 477, in handle_renewal_request
    len(renew_failures), len(parse_failures)))

person re1    schedule 13.04.2019    source источник
comment
Каково точное содержание /var/log/letsencrypt/letsencrypt.log?   -  person Andrew Eisenberg    schedule 16.04.2019
comment
@Andrew Eisenberg, добавляю letsencrypt.log.   -  person re1    schedule 16.04.2019
comment
OK. Это проясняет, в чем заключается ошибка. Вы используете не плагин nginx, а ручной плагин. См. Измененный ответ ниже.   -  person Andrew Eisenberg    schedule 16.04.2019
comment
Спасибо за редактирование. Я прочитал ответ и понял причину. Я вспомнил, что пытался получить подстановочный сертификат. Я хотел бы переписать файл конфигурации, чтобы использовать плагин nginx или удалить его один раз.   -  person re1    schedule 17.04.2019


Ответы (1)


Проблема здесь в том, что вы пытаетесь обновить сертификат на hoge.example.com, который вам почти наверняка не принадлежит. Плагин letsencrypt nginx обновит вашу конфигурацию nginx, чтобы в домене hoge.example.com был серверный блок, обслуживающий порт 80 (http). Он будет сервером пути в .well-known/<some-hash>. Затем сервер letsencrypt отправляет HTTP-запрос на http://hoge.example.com/.well-known/<some-hash>. Это не удается, поскольку вы фактически не владеете доменом.

Вам нужно изменить свою конфигурацию, чтобы вы создавали сертификат для домена, которым вы владеете.


РЕДАКТИРОВАТЬ: с журналом я знаю больше информации.

Ключевые строки журнала:

Requested authenticator manual and installer None
Other error:(PluginEntryPoint#manual): An authentication script must be provided with --manual-auth-hook when using the manual plugin non-interactively.

Это означает, что вы используете не плагин nginx, а ручной плагин . И когда вы используете ручной плагин, вам необходимо указать ловушку авторизации, которая, по сути, является способом доказать, что вы являетесь владельцем веб-сайта, о котором вы говорите. Вероятно, проблема с вашей конфигурацией.

Вот как выглядит мой:

# renew_before_expiry = 30 days
version = 0.32.0
archive_dir = /etc/letsencrypt/archive/my-domain.net
cert = /etc/letsencrypt/live/my-domain.net/cert.pem
privkey = /etc/letsencrypt/live/my-domain.net/privkey.pem
chain = /etc/letsencrypt/live/my-domain.net/chain.pem
fullchain = /etc/letsencrypt/live/my-domain.net/fullchain.pem

# Options used in the renewal process
[renewalparams]
installer = nginx
server = https://acme-v02.api.letsencrypt.org/directory
account = xxx123456789xxx
authenticator = nginx

Обратите внимание на разделы установщик и аутентификатор. Ваш должен выглядеть примерно так же.

Сначала я бы порекомендовал вам убедиться, что ваша конфигурация похожа на мою, и попробовать еще раз. Если это не сработает, вам, вероятно, следует просто удалить и заново создать свой сертификат.

person Andrew Eisenberg    schedule 14.04.2019
comment
Я заменил его на hoge.example.com, чтобы задать вопрос, но здесь я пробую использовать свой собственный домен. - person re1; 16.04.2019