Skip to content

Commit

Permalink
Disable SSL verification for some internal requests
Browse files Browse the repository at this point in the history
  • Loading branch information
ladrians committed Sep 19, 2024
1 parent e760996 commit ec52f14
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion saia_ingest/profile_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
from datetime import datetime, timezone
import logging
import requests
import urllib3
import json
from .log import AccumulatingLogHandler
from .config import DefaultHeaders

# Suppress the InsecureRequestWarning
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

def is_valid_profile(
base_url: str,
api_token: str,
Expand Down Expand Up @@ -298,7 +302,11 @@ def get_json_response_from_url(
h_subscription_key: h_subscription_value,
'Content-Type': DefaultHeaders.JSON_CONTENT_TYPE
}
response = requests.get(url, headers=headers)
response = requests.get(
url,
headers=headers,
verify=False # Disable SSL verification
)
if response.status_code == 401:
logging.getLogger().error(f"{response.status_code}: {response.text} - Getting new token and retrying...")
loader.bearer_token = get_bearer_token(loader)
Expand Down

0 comments on commit ec52f14

Please sign in to comment.