AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 831512
Accepted
Chloe
Chloe
Asked: 2017-02-09 21:10:30 +0800 CST2017-02-09 21:10:30 +0800 CST 2017-02-09 21:10:30 +0800 CST

如何停止 certbot 的弃用警告?

  • 772

我设置了一个 cron 来更新certbot。它每天都会发送弃用警告。如何停止弃用警告?

Cron <root@ip-99-99-99-99> /root/certbot-auto renew --quiet

/root/.local/share/letsencrypt/lib/python2.6/site-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
  DeprecationWarning

我试图提交错误报告,但他们关闭了它。https://github.com/certbot/certbot/issues/3984

我尝试安装 Python2.7,但无法让 certbot 与 Python2.7 一起运行。

[root@kizbit ~]# scl enable python27 "python --version"
Python 2.7.8

[root@kizbit ~]# scl enable python27 "/root/certbot-auto renew"
/root/.local/share/letsencrypt/lib/python2.6/site-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
  DeprecationWarning

它仍然使用 Python 2.6 并且仍然产生警告。我也试过:

[root@kizbit ~]# scl enable python27 "python /root/certbot-auto renew"
  File "/root/certbot-auto", line 18
    if [ -z "$XDG_DATA_HOME" ]; then
                           ^
SyntaxError: invalid syntax

使用 2.6 它可以工作,但会弃用:

[root@kizbit ~]# /root/certbot-auto renew
/root/.local/share/letsencrypt/lib/python2.6/site-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
  DeprecationWarning

Centos 6.8,证书机器人 0.12.0

centos certbot lets-encrypt
  • 4 4 个回答
  • 3316 Views

4 个回答

  • Voted
  1. SYN
    2017-02-09T21:27:43+08:002017-02-09T21:27:43+08:00

    您的问题已关闭,因为它与该问题重复,并带有指向进一步解释的链接。

    没有办法解决:您系统上可用的 Python 版本已经过时了。垃圾邮件“它仍在发生”将无济于事,一位成员已经请求帮助。如果该问题对您很重要,请随时贡献 PR。

    否则,我不建议将 certbot 输出删除到/dev/null, ... 但如果这些警告确实有问题,那么您可以考虑丢弃它们。

    • 0
  2. John Mahowald
    2017-02-09T21:38:28+08:002017-02-09T21:38:28+08:00

    Let's Encrypt 社区大约在 2015 年提出了几种获取 2.7、CentOS 软件集合或第三方存储库的方法。 Redhat / CentOS 6.x 用户需要 python 2.7

    这相当于在客户端安装python27包并用python27替换python2。由于 certbot 可以在 2.6 中使用,因此可能不是绝对必要的,但是对于获取更新的软件来说是一个很好的练习。

    从长远来看,您将希望迁移到更新版本的 CentOS。

    • 0
  3. tuomassalo
    2017-03-09T01:11:40+08:002017-03-09T01:11:40+08:00

    作为一个肮脏的临时解决方法,您可以在您的 cron 条目中尝试这样的事情:

    certbot renew ... 2>&1 | grep -v DeprecationWarning
    
    • 0
  4. Best Answer
    Chloe
    2017-03-16T14:10:40+08:002017-03-16T14:10:40+08:00

    我用SCL在 CentOS 6 上安装了 Python2.7 。

    yum install -y centos-release-scl
    yum install -y python27
    # scl enable python27 "python -V"
    Python 2.7.8
    

    然后你也必须删除

    rm -r ~/.local/share/letsencrypt
    

    并通过简单地运行它来重新安装与 Python 2.7 相关的东西(库?配置?)

    scl enable python27 "./certbot-auto"
    

    在 crontab 内部:

    @daily scl enable python27 "/root/certbot-auto renew --quiet"
    
    • 0

相关问题

  • 如何在 Linux 机器上找到有关硬件的详细信息?

  • 使用 crontab 和 /etc/cron.hourly,daily,weekly 的区别

  • 持续监控许多服务器运行状况的简单方法?

  • Hudson 无法在 tomcat5 中启动

  • CentOS 的依赖挑战

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve