Skip to content

Commit ba26d19

Browse files
authored
Gan explanation of how ssl works with our API (#211)
1 parent 5657c6b commit ba26d19

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

shotgun_api3/shotgun.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,35 @@ def __init__(self,
611611
"got '%s'." % self.config.rpc_attempt_interval)
612612

613613
self._connection = None
614+
615+
# The following lines of code allow to tell the API where to look for
616+
# certificate authorities certificates (we will be referring to these
617+
# as CAC from now on). Here's how the Python API interacts with those.
618+
#
619+
# Auth and CRUD operations
620+
# ========================
621+
# These operations are executed with httplib2. httplib2 ships with a
622+
# list of CACs instead of asking Python's ssl module for them.
623+
#
624+
# Upload/Downloads
625+
# ================
626+
# These operations are executed using urllib2. urllib2 asks a Python
627+
# module called `ssl` for CACs. On Windows, ssl searches for CACs in
628+
# the Windows Certificate Store. On Linux/macOS, it asks the OpenSSL
629+
# library linked with Python for CACs. Depending on how Python was
630+
# compiled for a given DCC, Python may be linked against the OpenSSL
631+
# from the OS or a copy of OpenSSL distributed with the DCC. This
632+
# impacts which versions of the certificates are available to Python,
633+
# as an OS level OpenSSL will be aware of system wide certificates that
634+
# have been added, while an OpenSSL that comes with a DCC is likely
635+
# bundling a list of certificates that get update with each release and
636+
# no not contain system wide certificates.
637+
#
638+
# Using custom CACs
639+
# =================
640+
# When a user requires a non-standard CAC, the SHOTGUN_API_CACERTS
641+
# environment variable allows to provide an alternate location for
642+
# the CACs.
614643
if ca_certs is not None:
615644
self.__ca_certs = ca_certs
616645
else:

0 commit comments

Comments
 (0)