Skip to content

Commit fa89746

Browse files
author
Gauvain Pocentek
committed
[doc] Add sample code for client-side certificates
Closes python-gitlab#23
1 parent 226e6ce commit fa89746

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/api-usage.rst

+23
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ HTTP requests to the Gitlab servers.
253253
You can provide your own ``Session`` object with custom configuration when
254254
you create a ``Gitlab`` object.
255255

256+
Proxy configuration
257+
-------------------
258+
256259
The following sample illustrates how to define a proxy configuration when using
257260
python-gitlab:
258261

@@ -267,3 +270,23 @@ python-gitlab:
267270
'http': os.environ.get('http_proxy'),
268271
}
269272
gl = gitlab.gitlab(url, token, api_version=4, session=session)
273+
274+
Reference:
275+
http://docs.python-requests.org/en/master/user/advanced/#proxies
276+
277+
Client side certificate
278+
-----------------------
279+
280+
The following sample illustrates how to use a client-side certificate:
281+
282+
.. code-block:: python
283+
284+
import gitlab
285+
import requests
286+
287+
session = requests.Session()
288+
s.cert = ('/path/to/client.cert', '/path/to/client.key')
289+
gl = gitlab.gitlab(url, token, api_version=4, session=session)
290+
291+
Reference:
292+
http://docs.python-requests.org/en/master/user/advanced/#client-side-certificates

0 commit comments

Comments
 (0)