Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit f68c542

Browse files
authored
Merge pull request #65 from Clever/v2.5.0
v2.5.0 - remove cert pinning
2 parents a754b29 + d321c84 commit f68c542

File tree

6 files changed

+7
-50
lines changed

6 files changed

+7
-50
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 2.5.0 (2020-04-20)
2+
* Remove certificate pinning
3+
14
## 2.4.0 (2017-09-18)
25
* Use API v1.2
36

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include *.txt clever/VERSION clever/data/clever.com_ca_bundle.crt
1+
include *.txt clever/VERSION

clever/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.0
1+
2.5.0

clever/__init__.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@
8080

8181
logger = logging.getLogger('clever')
8282

83-
# Use certs chain bundle including in the package for SSL verification
84-
CLEVER_CERTS = pkg_resources.resource_filename(__name__, 'data/clever.com_ca_bundle.crt')
8583
API_VERSION = "v1.2"
8684

8785
# Configuration variables
@@ -305,17 +303,8 @@ def requests_request(self, meth, abs_url, headers, params):
305303

306304
try:
307305
try:
308-
# Use a CA_BUNDLE containing the following chain:
309-
# - TrustedRoot
310-
# - DigiCert High Assurance EV - 1
311-
#
312-
# This ensures that only this certificate chain is used to verify SSL certs.
313-
# Certs dervived from other ca certs will be treated as invalid.
314-
# eg. https://api.twitter.com and https://api.stripe.com FAIL
315-
# https://api.clever.com and https://api.github.com PASS
316306
result = requests.request(meth, abs_url,
317-
headers=headers, data=data, timeout=80,
318-
verify=CLEVER_CERTS)
307+
headers=headers, data=data, timeout=80)
319308
except TypeError as e:
320309
raise TypeError(
321310
'Warning: It looks like your installed version of the "requests" library is not compatible with Clever\'s usage thereof. (HINT: The most likely cause is that your "requests" library is out of date. You can fix that by running "pip install -U requests".) The underlying error was: %s' % (e, ))
@@ -378,10 +367,6 @@ def pycurl_request(self, meth, abs_url, headers, params):
378367
curl.setopt(pycurl.TIMEOUT, 80)
379368
curl.setopt(pycurl.HTTPHEADER, ['%s: %s' % (k, v) for k, v in six.iteritems(headers)])
380369
curl.setopt(pycurl.HEADERFUNCTION, rheader.write)
381-
if verify_ssl_certs:
382-
curl.setopt(pycurl.CAINFO, CLEVER_CERTS)
383-
else:
384-
curl.setopt(pycurl.SSL_VERIFYHOST, False)
385370

386371
try:
387372
curl.perform()
@@ -419,9 +404,6 @@ def urlfetch_request(self, meth, abs_url, headers, params):
419404
args['url'] = abs_url
420405
args['method'] = meth
421406
args['headers'] = headers
422-
# Google App Engine doesn't let us specify our own cert bundle.
423-
# However, that's ok because the CA bundle they use recognizes
424-
# api.clever.com.
425407
args['validate_certificate'] = verify_ssl_certs
426408
# GAE requests time out after 60 seconds, so make sure we leave
427409
# some time for the application to handle a slow Clever

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
author_email='tech-support@clever.com',
3535
url='https://clever.com/',
3636
packages=['clever'],
37-
package_data={'clever' : ['data/clever.com_ca_bundle.crt', 'VERSION']},
37+
package_data={'clever' : ['VERSION']},
3838
install_requires=install_requires,
3939
test_suite='test',
4040
)

test/test_cert_pinning.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)