@@ -213,7 +213,8 @@ def __init__(self,
213213 convert_datetimes_to_utc = True ,
214214 http_proxy = None ,
215215 ensure_ascii = True ,
216- connect = True ):
216+ connect = True ,
217+ ca_certs = None ):
217218 """Initialises a new instance of the Shotgun client.
218219
219220 :param base_url: http or https url to the shotgun server.
@@ -234,13 +235,18 @@ def __init__(self,
234235 form [username:pass@]proxy.com[:8080]
235236
236237 :param connect: If True, connect to the server. Only used for testing.
238+
239+ :param ca_certs: The path to the SSL certificate file. Useful for users
240+ who would like to package their application into an executable.
237241 """
242+
238243 self .config = _Config ()
239244 self .config .api_key = api_key
240245 self .config .script_name = script_name
241246 self .config .convert_datetimes_to_utc = convert_datetimes_to_utc
242247 self .config .no_ssl_validation = NO_SSL_VALIDATION
243248 self ._connection = None
249+ self .__ca_certs = ca_certs
244250
245251 self .base_url = (base_url or "" ).lower ()
246252 self .config .scheme , self .config .server , api_base , _ , _ = \
@@ -1566,10 +1572,10 @@ def _get_connection(self):
15661572 pi = ProxyInfo (socks .PROXY_TYPE_HTTP , self .config .proxy_server ,
15671573 self .config .proxy_port , proxy_user = self .config .proxy_user ,
15681574 proxy_pass = self .config .proxy_pass )
1569- self ._connection = Http (timeout = self .config .timeout_secs ,
1575+ self ._connection = Http (timeout = self .config .timeout_secs , ca_certs = self . __ca_certs ,
15701576 proxy_info = pi , disable_ssl_certificate_validation = self .config .no_ssl_validation )
15711577 else :
1572- self ._connection = Http (timeout = self .config .timeout_secs ,
1578+ self ._connection = Http (timeout = self .config .timeout_secs , ca_certs = self . __ca_certs ,
15731579 disable_ssl_certificate_validation = self .config .no_ssl_validation )
15741580
15751581 return self ._connection
@@ -1802,4 +1808,4 @@ def _translate_filters_simple(sg_filter):
18021808
18031809 return condition
18041810
1805-
1811+
0 commit comments