0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Python】SSL関係でエラーが発生

Posted at

エラー文

URLError <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1124)>

解決方法

import ssl

ssl._create_default_https_context = ssl._create_unverified_context

エラーが出るコードに上記のコードを追加することで解決した。

おわり

詳しくはわかりませんが、
検証されていないSSLを使えるようにするコードだと思うので、セキュリティ的にはよろしくないと思います。

0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?