Skip to content

Commit fe0a4f4

Browse files
committed
remove trusted-certs, make ca_certs optional
1 parent 75596da commit fe0a4f4

File tree

4 files changed

+3
-1408
lines changed

4 files changed

+3
-1408
lines changed

dropbox/dropbox_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ def __init__(self,
181181
Not required if PKCE was used to authorize the token
182182
:param list scope: list of scopes to request on refresh. If left blank,
183183
refresh will request all available scopes for application
184-
:param str ca_certs: path to CA certificate. If left blank, default certificate location \
185-
will be used
184+
:param str ca_certs: if specified, a path to a file of concatenated CA certificates in PEM
185+
format; has the same meaning as when using :meth:`ssl.SSLContext.wrap_socket`.
186186
"""
187187

188188
if not (oauth2_access_token or oauth2_refresh_token or (app_key and app_secret)):

dropbox/session.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import pkg_resources
21
import os
32
import ssl
43

@@ -32,21 +31,14 @@
3231
# This is the default longest time we'll block on receiving data from the server
3332
DEFAULT_TIMEOUT = 100
3433

35-
try:
36-
_TRUSTED_CERT_FILE = pkg_resources.resource_filename(__name__, 'trusted-certs.crt')
37-
except NotImplementedError: # Package is used inside python archive
38-
_TRUSTED_CERT_FILE = None
39-
4034

4135
# TODO(kelkabany): We probably only want to instantiate this once so that even
4236
# if multiple Dropbox objects are instantiated, they all share the same pool.
4337
class _SSLAdapter(HTTPAdapter):
4438
_ca_certs = None
4539

4640
def __init__(self, *args, **kwargs):
47-
self._ca_certs = kwargs.pop("ca_certs", None) or _TRUSTED_CERT_FILE
48-
if not self._ca_certs:
49-
raise AttributeError("CA certificate not set")
41+
self._ca_certs = kwargs.pop("ca_certs", None)
5042
super(_SSLAdapter, self).__init__(*args, **kwargs)
5143

5244
def init_poolmanager(self, connections, maxsize, block=False, **_):

0 commit comments

Comments
 (0)