Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions upwork/ca_certs_locater.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@

LINUX_PATH = '/etc/ssl/certs/ca-certificates.crt'

# openssl installed using `brew install openssl`
OSX_PATH = '/usr/local/etc/openssl/cert.pem'


def get():
"""Return a path to a certificate authority file.
"""
# FIXME(dhellmann): Assume Linux for now, add more OSes and
# platforms later.

if os.path.exists(LINUX_PATH):
return LINUX_PATH

if os.path.exists(OSX_PATH):
return OSX_PATH

# Fall back to the httplib2 default behavior by raising an
# ImportError if we have not found the file.
raise ImportError()