DESCRIPTION.rst 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. Certifi: Python SSL Certificates
  2. ================================
  3. `Certifi`_ is a carefully curated collection of Root Certificates for
  4. validating the trustworthiness of SSL certificates while verifying the identity
  5. of TLS hosts. It has been extracted from the `Requests`_ project.
  6. Installation
  7. ------------
  8. ``certifi`` is available on PyPI. Simply install it with ``pip``::
  9. $ pip install certifi
  10. Usage
  11. -----
  12. To reference the installed certificate authority (CA) bundle, you can use the
  13. built-in function::
  14. >>> import certifi
  15. >>> certifi.where()
  16. '/usr/local/lib/python2.7/site-packages/certifi/cacert.pem'
  17. Enjoy!
  18. 1024-bit Root Certificates
  19. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  20. Browsers and certificate authorities have concluded that 1024-bit keys are
  21. unacceptably weak for certificates, particularly root certificates. For this
  22. reason, Mozilla has removed any weak (i.e. 1024-bit key) certificate from its
  23. bundle, replacing it with an equivalent strong (i.e. 2048-bit or greater key)
  24. certificate from the same CA. Because Mozilla removed these certificates from
  25. its bundle, ``certifi`` removed them as well.
  26. Unfortunately, old versions of OpenSSL (less than 1.0.2) sometimes fail to
  27. validate certificate chains that use the strong roots. For this reason, if you
  28. fail to validate a certificate using the ``certifi.where()`` mechanism, you can
  29. intentionally re-add the 1024-bit roots back into your bundle by calling
  30. ``certifi.old_where()`` instead. This is not recommended in production: if at
  31. all possible you should upgrade to a newer OpenSSL. However, if you have no
  32. other option, this may work for you.
  33. .. _`Certifi`: http://certifi.io/en/latest/
  34. .. _`Requests`: http://docs.python-requests.org/en/latest/