LoginSignup
3
0

More than 5 years have passed since last update.

python2の環境でLet's Encryptで./certbot-auto renewがエラーになった場合の対処

Posted at

前提

対象読者:以下を満たす方
- 安いVPSサーバー等、環境構築に制限がありpython2を使っている
- Let's Encryptを使って証明書管理をしている/したい

本文

python2でLet's Encryptを利用する為certbot-autoを実行したところ、以下のようなエラーが発生して証明書のupdateが出来ませんでした。

/opt/eff.org/certbot/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail.

なんかSSL周りでエラーになっていますね。速攻エラーログの内容をそのままぺってググった結果以下をインスト―ルすることに。(logにも出ているurllib3です)

# pip install urllib3
Collecting urllib3
  Downloading https://files.pythonhosted.org/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl (118kB)
    100% |################################| 122kB 8.2kB/s
Installing collected packages: urllib3
Successfully installed urllib3-1.24.1

結果、無事にrenewが通るようになりました。
手元の環境だと証明書の期限が来ていないのでこんな感じでupdateは実行されません

# ./certbot-auto renew
/opt/eff.org/certbot/venv/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
  utils.PersistentlyDeprecated2018,
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/server.developerkikikaikaienjoy.work.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert not yet due for renewal

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

The following certs are not due for renewal yet:
  /etc/letsencrypt/live/server.developerkikikaikaienjoy.work/fullchain.pem expires on 2019-06-21 (skipped)
No renewals were attempted.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

renew出来ることが確認できたら、定期実行を仕込んでおきましょう

その他

Python 2.7のサポートは2020/1/1までです。update出来る環境ならupdateしましょう。

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.

参考

python 2.7.5 の requests モジュールを用いたら warning が表示される理由は?

3
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0