-
Notifications
You must be signed in to change notification settings - Fork 38
Description
Is your feature request related to a problem? Please describe.
Currently, the Smartsheet Python SDK does not provide a way to customize the certificate CA path or CA bundle used for HTTPS requests. This limits the flexibility needed for environments with custom CA requirements or security policies. As a workaround, users must resort to monkey-patching SSL adapter logic, such as:
import os
import ssl
import certifi
import smartsheet
from smartsheet.session import _SSLAdapter
from urllib3.poolmanager import PoolManager
def get_requests_ca_bundle() -> str:
"""Returns the path to the requests CA Bundle, if not set, then returns the default location from certifi."""
return os.getenv("REQUESTS_CA_BUNDLE", certifi.where())
def init_poolmanager(self, connections, maxsize, block=False):
"""A quick monkey-patching solution to force the SmartSheet client to use the requests CA Bundle for certs instead of the default certifi location."""
self.poolmanager = PoolManager(
num_pools=connections,
maxsize=maxsize,
block=block,
cert_reqs=ssl.CERT_REQUIRED,
ca_certs=get_requests_ca_bundle(),
ssl_context=self.create_ssl_context(),
)
_SSLAdapter.init_poolmanager = init_poolmanager
client = smartsheet.Smartsheet(access_token='sometoken')Describe the solution you'd like
I'd like the SDK to support an option for specifying a custom CA path or CA bundle natively, rather than requiring a monkey-patch or hack. This should be configurable through client initialization or API settings.
Additional context
The issue impacts teams in restricted environments, automation, and CI/CD scenarios. Most other Python SDKs provide settings for this, such as allowing a ca_certs parameter or environment variable for certificate customization. The lack of support can be a security and usability risk.
Environment (please complete the following information):
- OS: Ubuntu 24
- Smartsheet API Version N/A
- Smartsheet Python SDK Version 3.1.0
- Python Version 3.12