letsencrypt-auto无法正确创建证书

时间:2016-02-12 22:39:14

标签: linux apache ssl-certificate lets-encrypt

我正在遵循本指南:https://www.digitalocean.com/community/tutorials/how-to-set-up-let-s-encrypt-certificates-for-multiple-apache-virtual-hosts-on-ubuntu-14-04

我确实拉了git repo,如教程中所示,当我运行命令./letsencrypt-auto --apache -d example.com -d www.example.com,其中example.com是我的实际网站时,它确实问我联系人的电子邮件地址,但后来弹出剩余的动作,它提出了这个错误信息:

An unexpected error occurred: NameError: free variable 'addrs' referenced before assignment in enclosing scope

但它创建了证书。我试过网站ssllabs,但它说服务器正在侦听端口443,但没有提供安全传输,https://example.com实际上也没有工作(没有加载)。

我尝试多次再次运行它,甚至重新拉动git repo,但总是出现相同的错误信息。

日志文件的完整内容(最后38行代表错误,用$ USER替换登录用户):

2016-02-11 16:59:24,530:DEBUG:letsencrypt.error_handler:Encountered exception:
Traceback (most recent call last):
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/client.py", line 355, in deploy_certificate
    fullchain_path=fullchain_path)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 214, in deploy_cert
    vhost = self.choose_vhost(domain)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 308, in choose_vhost
    vhost = self.make_vhost_ssl(vhost)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 733, in make_vhost_ssl
    self._add_name_vhost_if_necessary(ssl_vhost)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 905, in _add_name_vhost_if_necessary
    test_addr in test_vh.addrs) and
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 905, in <genexpr>
    test_addr in test_vh.addrs) and
NameError: free variable 'addrs' referenced before assignment in enclosing scope

2016-02-11 16:59:24,530:DEBUG:letsencrypt.error_handler:Calling registered functions
2016-02-11 16:59:24,534:DEBUG:letsencrypt.cli:Exiting abnormally:
Traceback (most recent call last):
  File "/home/$USER/.local/share/letsencrypt/bin/letsencrypt", line 11, in <module>
    sys.exit(main())
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/cli.py", line 1987, in main
    return config.func(config, plugins)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/cli.py", line 667, in run
    lineage.chain, lineage.fullchain)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/client.py", line 355, in deploy_certificate
    fullchain_path=fullchain_path)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 214, in deploy_cert
    vhost = self.choose_vhost(domain)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 308, in choose_vhost
    vhost = self.make_vhost_ssl(vhost)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 733, in make_vhost_ssl
    self._add_name_vhost_if_necessary(ssl_vhost)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 905, in _add_name_vhost_if_necessary
    test_addr in test_vh.addrs) and
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 905, in <genexpr>
    test_addr in test_vh.addrs) and
NameError: free variable 'addrs' referenced before assignment in enclosing scope

这是什么问题,我该怎么办呢?

感谢您的阅读。

1 个答案:

答案 0 :(得分:1)

此错误存在已解决的问题,并已进行修复:

https://github.com/letsencrypt/letsencrypt/issues/2470

我必须手动应用补丁。希望当0.4.1出现时,这不会成为一个问题。