Skip to content
Myr

Exposed key_file and cert_file in requests, to support https client certificates.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by chadnickbok@gmail.com · committed by chadnickbok@gmail.com · parent cc4381b · Browse files · 3 files+23 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+23 added−3 removed

  • other:+23 added−3 removed

3 files+23 added−3 removed

modified:requests/api.py+2 added
31 unmodified lines
32 :param session: (optional) A :class:`Session` object to be used for the request.33 :param config: (optional) A configuration dictionary.34 :param verify: (optional) if ``True``, the SSL cert will be verified. A CA_BUNDLE path can also be provided.35 :param prefetch: (optional) if ``True``, the response content will be immediately downloaded.36 :param key_file: (optional) ssl client key file.37 :param cert_file: (optional) ssl client cert file.38 """3940 s = kwargs.pop('session') if 'session' in kwargs else sessions.session()41 return s.request(method=method, url=url, **kwargs)
77 unmodified lines
modified:requests/models.py+11 added-1 removed
61 unmodified lines
62 hooks=None,63 config=None,64 _poolmanager=None,65 verify=None,66 session=None):66 session=None,67 key_file=None,68 cert_file=None):6970 #: Dictionary of configurations for this request.71 self.config = dict(config or [])72
71 unmodified lines
144145 #: SSL Verification.146 self.verify = verify147148 #: SSL Certificate149 self.key_file = key_file150 self.cert_file = cert_file151152 if headers:153 headers = CaseInsensitiveDict(self.headers)154 else:155 headers = CaseInsensitiveDict()
356 unmodified lines
512 else:513 conn.cert_reqs = 'CERT_NONE'514 conn.ca_certs = None515516 if self.key_file and self.cert_file:517 conn.key_file = self.key_file518 conn.cert_file = self.cert_file519520 if not self.sent or anyway:521522 if self.cookies:523
303 unmodified lines
modified:requests/sessions.py+10 added-2 removed
75 unmodified lines
76 hooks=None,77 params=None,78 config=None,79 prefetch=False,80 verify=True):80 verify=True,81 key_file=None,82 cert_file=None):8384 self.headers = headers or {}85 self.cookies = cookies or {}86 self.auth = auth
3 unmodified lines
90 self.params = params or {}91 self.config = config or {}92 self.prefetch = prefetch93 self.verify = verify94 self.key_file = key_file95 self.cert_file = cert_file9697 for (k, v) in list(defaults.items()):98 self.config.setdefault(k, v)99
34 unmodified lines
134 hooks=None,135 return_response=True,136 config=None,137 prefetch=False,134 verify=None):138 verify=None,139 key_file=None,140 cert_file=None):141142 """Constructs and sends a :class:`Request <Request>`.143 Returns :class:`Response <Response>` object.144
48 unmodified lines
193 allow_redirects=allow_redirects,194 proxies=proxies,195 config=config,196 verify=verify,197 key_file=key_file,198 cert_file=cert_file,199 _poolmanager=self.poolmanager200 )201202 # Merge local kwargs with session kwargs.
118 unmodified lines