ezbz / gitlabber

Gitlabber - clones or pulls entire groups tree from gitlab
MIT License
483 stars 80 forks source link

Self signed certificate support #106

Closed g0ddest closed 3 months ago

g0ddest commented 1 year ago

It will be nice to have an opportunity to pin own CA certificate or skip certificate error that is happen when trying to use with gitlab with self-signed SSL certificate: requests.exceptions.SSLError: HTTPSConnectionPool(host='gitlab.example.com', port=443): Max retries exceeded with url: /api/v4/groups (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))

guadaduche commented 1 year ago

Hi I have same issue as @g0ddest I agree, it could be nice to bypass ssl certificate verify Do you have an advice to ignore this ? (which code to edit ?) Thx

s00ner commented 11 months ago

I'm in the same boat, really would appreciate a flag to ignore SSL validation issues.

JosephBowkett commented 11 months ago

You can already use a self signed certificate by setting the OS environment variable REQUESTS_CA_BUNDLE to the path of your self signed cert, which is used inside the get_ca_path() function of script gitlab_tree.py

For example, on Ubuntu I ran: REQUESTS_CA_BUNDLE=/etc/ssl/certs/some.website.com.pem /home/user/.local/bin/gitlabber -t gItLabperSoNalTokeN -p -u https://some.website.com which still complains about SSL but works.

Or if you don't have the certificate installed... you can always change True to False on your local install here and the problem magically goes away.