Skip to content

Commit

Permalink
Use certifi to get access to the older, weaker CA Certificate list.
Browse files Browse the repository at this point in the history
  • Loading branch information
hodgestar committed Apr 14, 2016
1 parent acbc642 commit 8de1aea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
'PyYAML',
'iso8601',
'pyOpenSSL',
'certifi',
'service_identity',
'txssmi>=0.3.0',
'wokkel',
Expand Down
11 changes: 11 additions & 0 deletions vumi/transports/vumi_bridge/vumi_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import base64
import json
import os

import certifi

from twisted.internet.defer import inlineCallbacks
from twisted.web import http
Expand Down Expand Up @@ -198,6 +201,7 @@ class GoConversationTransport(GoConversationTransportBase):

@inlineCallbacks
def setup_transport(self):
self.setup_cacerts()
config = self.get_static_config()
self.redis = yield TxRedisManager.from_config(
config.redis_manager)
Expand All @@ -214,6 +218,13 @@ def setup_transport(self):
def teardown_transport(self):
return self.web_resource.loseConnection()

def setup_cacerts(self):
# TODO: This installs an older CA certificate chain that allows
# some weak CA certificates. We should switch to .where() when
# Vumi Go's certificate doesn't rely on older intermediate
# certificates.
os.environ["SSL_CERT_FILE"] = certifi.old_where()

def get_transport_url(self, suffix=''):
"""
Get the URL for the HTTP resource. Requires the worker to be started.
Expand Down

0 comments on commit 8de1aea

Please sign in to comment.