Skip to content

Commit

Permalink
fix: Use botocore ssl context for telemetry requests (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
marofke authored Mar 27, 2024
1 parent c8151db commit 6a6b114
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/deadline/client/api/_telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
import platform
import uuid
import random
import ssl
import time

from botocore.httpsession import get_cert_path
from botocore.httpsession import create_urllib3_context, get_cert_path
from configparser import ConfigParser
from dataclasses import asdict, dataclass, field
from datetime import datetime
Expand Down Expand Up @@ -93,12 +92,8 @@ def __init__(
self._initialized: bool = False
self.package_name = package_name
self.package_ver = ".".join(package_ver.split(".")[:3])

# Need to set up a valid SSL context so requests can make it through
self._urllib3_context = ssl.SSLContext(ssl.PROTOCOL_TLS)
self._urllib3_context.verify_mode = ssl.CERT_REQUIRED
self._urllib3_context.check_hostname = True
self._urllib3_context.load_default_certs()
# Some environments might not have SSL, so we'll use the vendored botocore SSL context
self._urllib3_context = create_urllib3_context()
self._urllib3_context.load_verify_locations(cafile=get_cert_path(True))

# IDs for this session
Expand Down

0 comments on commit 6a6b114

Please sign in to comment.