From fa897468cf565fb8546b47637cd9703981aedbc0 Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Fri, 3 Nov 2017 15:22:11 +0100 Subject: [doc] Add sample code for client-side certificates Closes #23 --- docs/api-usage.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'docs/api-usage.rst') diff --git a/docs/api-usage.rst b/docs/api-usage.rst index ad188ce..edd41d0 100644 --- a/docs/api-usage.rst +++ b/docs/api-usage.rst @@ -253,6 +253,9 @@ HTTP requests to the Gitlab servers. You can provide your own ``Session`` object with custom configuration when you create a ``Gitlab`` object. +Proxy configuration +------------------- + The following sample illustrates how to define a proxy configuration when using python-gitlab: @@ -267,3 +270,23 @@ python-gitlab: 'http': os.environ.get('http_proxy'), } gl = gitlab.gitlab(url, token, api_version=4, session=session) + +Reference: +http://docs.python-requests.org/en/master/user/advanced/#proxies + +Client side certificate +----------------------- + +The following sample illustrates how to use a client-side certificate: + +.. code-block:: python + + import gitlab + import requests + + session = requests.Session() + s.cert = ('/path/to/client.cert', '/path/to/client.key') + gl = gitlab.gitlab(url, token, api_version=4, session=session) + +Reference: +http://docs.python-requests.org/en/master/user/advanced/#client-side-certificates -- cgit v1.2.1