Skip to content

Commit

Permalink
fix: let epss work behind proxy (#4166)
Browse files Browse the repository at this point in the history
Thanks to @alext-w for finding this one.

Needed to add trust_env=True to the aiohttp connections in the epss data
source because otherwise it ignores proxy settings (and thus won't work
at all for users behind a proxy)

* fixes #4083

Signed-off-by: Terri Oda <[email protected]>
  • Loading branch information
terriko authored Jun 10, 2024
1 parent 4310c04 commit 3c62f30
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cve_bin_tool/data_sources/epss_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ async def download_epss_data(self):
# Check if the file is older than 24 hours
if time_difference > timedelta(hours=24):
try:
async with aiohttp.ClientSession(headers=HTTP_HEADERS) as session:
async with aiohttp.ClientSession(
headers=HTTP_HEADERS, trust_env=True
) as session:
async with session.get(self.DATA_SOURCE_LINK) as response:
response.raise_for_status()
self.LOGGER.info("Getting EPSS data...")
Expand All @@ -89,7 +91,9 @@ async def download_epss_data(self):

else:
try:
async with aiohttp.ClientSession(headers=HTTP_HEADERS) as session:
async with aiohttp.ClientSession(
headers=HTTP_HEADERS, trust_env=True
) as session:
async with session.get(self.DATA_SOURCE_LINK) as response:
response.raise_for_status()
self.LOGGER.info("Getting EPSS data...")
Expand Down

0 comments on commit 3c62f30

Please sign in to comment.