0

我正在关注本指南: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

这是什么问题,我该如何解决?

感谢您的阅读。

4

1 回答 1

1

这里有一个关于此错误的已关闭问题,并且已进行修复:

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

我不得不手动应用补丁。希望当 0.4.1 发布时这不会成为问题。

于 2016-02-23T15:25:00.733 回答