Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion repgen/data/value.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import pytz,datetime,sys,time as ttime
import operator
from inspect import isfunction
Expand All @@ -21,7 +22,7 @@
from datetime import timedelta

# need to enable legacy ciphers for public CDA instance
ssl_ctx = ssl.create_default_context()
ssl_ctx = ssl.create_default_context(cafile=os.getenv("REQUESTS_CA_BUNDLE", None))
Comment thread
krowvin marked this conversation as resolved.
ssl_ctx.set_ciphers('DEFAULT')

# types
Expand Down
3 changes: 3 additions & 0 deletions repgen/util/urllib2_tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import socket
import ssl
import sys
import os
# From: https://gist.github.com/flandr/74be22d1c3d7c1dfefdd

# Python 2.6's urllib2 does not allow you to select the TLS dialect,
Expand All @@ -14,6 +15,8 @@ class TLS1Connection(httplib.HTTPSConnection):
"""Like HTTPSConnection but more specific"""
def __init__(self, host, **kwargs):
httplib.HTTPSConnection.__init__(self, host, **kwargs)
# Take advantage of the requestsCA env var
self.cert_file = os.getenv("REQUESTS_CA_BUNDLE", self.cert_file)

def connect(self):
"""Overrides HTTPSConnection.connect to specify TLS version"""
Expand Down
Loading