Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python-gitlab api SSL bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],

I want to list all the issues in a github repository.

Python3 code:

import gitlab
gl = gitlab.Gitlab('https://git.myinternalsite.com/project', private_token='XXXXXXXXXXXXXXX', api_version=4) 

issues = gl.issues.list()

This generates the following error:

SSLError: HTTPSConnectionPool(host='git.zonetrading.com', port=443): Max retries exceeded with url: /cloudquant/user-issues/api/v4/issues (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),))

Any ideas on how to correct the error?

like image 904
TayloeD Avatar asked Jan 09 '18 22:01

TayloeD


1 Answers

The problem seems to be a faulty configured webserver.

The TLS certificate is only certified for the domain www.parkingcrew.comand not for git.zonetrading.com this leads to the certificate verify failederror.

To fix this you have to request a new certificate which includes the target domain, in this case git.zonetrading.com.

To confirm this is the only error, you can turn off the certificate verification in the client using the ssl_verify parameter.

gl = gitlab.Gitlab('https://git.myinternalsite.com/project', private_token='XXXXXXXXXXXXXXX', api_version=4, ssl_verify=False) 
like image 198
secustor Avatar answered Oct 12 '22 03:10

secustor