certs.py 544 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. certs.py
  5. ~~~~~~~~
  6. This module returns the preferred default CA certificate bundle.
  7. If you are packaging Requests, e.g., for a Linux distribution or a managed
  8. environment, you can change the definition of where() to return a separately
  9. packaged CA bundle.
  10. """
  11. import os.path
  12. def where():
  13. """Return the preferred certificate bundle."""
  14. # vendored bundle inside Requests
  15. return os.path.join(os.path.dirname(__file__), 'cacert.pem')
  16. if __name__ == '__main__':
  17. print(where())