Skip to content

Respect content of REQUESTS_CA_BUNDLE #352

Description

@rnestler

It seems to me as if the gitlab package does not use the REQUESTS_CA_BUNDLE environment variable to do TLS verification:

gl = gitlab.Gitlab(remote_host_url, token, api_version=4)
gl.projects.get(id)

Fails:

(self, request, stream, timeout, verify, cert, proxies)
    504             if isinstance(e.reason, _SSLError):
    505                 # This branch is for urllib3 v1.22 and later.
--> 506                 raise SSLError(e, request=request)
    507 
    508             raise ConnectionError(e, request=request)

SSLError: HTTPSConnectionPool(host='gitlab', port=443): Max retries exceeded with url: //api/v4/projects/12 (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),))

If I explicitly add the content of REQUESTS_CA_BUNDLE the connection works:

gl = gitlab.Gitlab(remote_host_url, token, api_version=4, ssl_verify=os.environ['REQUESTS_CA_BUNDLE'])

Is this expected behavior? In my opinion the gitlab package should pass the content of REQUESTS_CA_BUNDLE to requests if it exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions