SurveyMonkey / pyteamcity

Use the TeamCity REST API from Python
51 stars 50 forks source link

Library not working with secured connection of teamcity server #87

Open adityabyreddy opened 7 years ago

adityabyreddy commented 7 years ago

Couldn't able to get the projects or any other info for a teamcity server running with secured connection.

Output

Traceback (most recent call last): File "C:\Workspace\VSphereAPI\bin\download_latest_plugin_build.py", line 4, in tc.get_builds(project="Eclipse") File "C:\Python27\lib\site-packages\pyteamcity\legacy\legacy.py", line 237, in get_builds **kwargs) File "C:\Python27\lib\site-packages\pyteamcity\legacy\legacy.py", line 92, in inner_func response = self._get(url) File "C:\Python27\lib\site-packages\pyteamcity\legacy\legacy.py", line 164, in _get return self._send_request(request) File "C:\Python27\lib\site-packages\pyteamcity\legacy\legacy.py", line 182, in _send_request raise new_exception ConnectionError: Failed to connect to https://teamcity-url:443

bgyu commented 6 years ago

I got the same error.

schancel commented 6 years ago

So I got this working, but you need to specify the protocol in the initialization of the object:

TeamCity('username', 'password', 'build.host.org', 443, None, 'https')

per https://github.com/SurveyMonkey/pyteamcity/blob/master/pyteamcity/legacy/legacy.py#L127