0

I am using python reqests.get() to invoke one of gitlab api's in my Python script running on Windows. It works fine on my dev machine, but it fails with below error message when I run the script in TeamCity job runner.

HTTPSConnectionPool(host='gitlab.myservice.com', port=443): Max retries exceeded with url: /api/v4/projects/1111/pipeline_schedules/111?private_token=******* (Caused by SSLError(SSLError(1, '_ssl.c:503: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure'),))

What is very strange is that very similar script that calls Artifactory rest api runs just fine in the same script even when it runs in TeamCity.

Can anybody shed light on this mystery?

Update

The infra is using Python 2.7.16. When I tested with Python 3.x it worked fine. However, the org is not ready to move to 3.x due to dependencies they cannot solve yet.

Kay
  • 1,235
  • 2
  • 13
  • 27
  • 1
    Looks like an SSL failure. Does your gitlab server have a valid/trusted certificate? Maybe your TeamCity job runner needs to update its CA certs. – sytech Apr 06 '22 at 21:56
  • Thanks sytech. My IT team says the certificate is fine. I did more test and find out it happens with Python2.7.16. I tried Python 3.x and it is not happening. However, I am stuck with Python 2.7.16, not by my choice. – Kay Apr 07 '22 at 18:31
  • 1
    Have you seen https://stackoverflow.com/questions/31649390/python-requests-ssl-handshake-failure ? – Layne Bernardo Apr 07 '22 at 18:53
  • I am actually trying to confirm if requests was pip'ed [security] option. Do you know how to do that? – Kay Apr 07 '22 at 20:39

0 Answers0