Unable to connect to python-gitlab

Question:

I am attempting to use python-gitlab to create a script that automates the creation of branches. However, when I try to connect and get a specific group, I get the error:

Exception has occurred: SSLError
HTTPSConnectionPool(host='gitlab.X.com', port=443): Max retries exceeded with url: /api/v4/groups/17996 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)')))

During handling of the above exception, another exception occurred:


During handling of the above exception, another exception occurred:

  File "X", line 4, in <module>
    group = gl.groups.get(17996)

This is my first experience using Python and I can’t figure out what the issue is. I have tried with multiple access tokens, but always get this exact error.

Here is the code:

import gitlab

gl = gitlab.Gitlab('https://gitlab.X.com/', 'the_access_code')
group = gl.groups.get(17996)


def main():


main()

Any help is greatly appreciated.

Asked By: web1connoisseur

||

Answers:

Adding this parameter ‘ssl_verify’ bypassed the exception:

gl = gitlab.Gitlab('https://gitlab.X.com/', 'the_access_code', ssl_verify = False)
Answered By: web1connoisseur
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.