eventbrite / Casper-API-Tools

Python Command Line Interface for performing Casper Suite JSS commands.
Apache License 2.0
0 stars 2 forks source link

CasperAPI.py is not working #4

Open hpanwar2 opened 5 years ago

hpanwar2 commented 5 years ago

Hi I am trying to run CasperAPI.py to unmanage macs and perform other tasks. However when i run this i get below error message I am running this as admin, i have also remove and re-setup this on my Mac however stil giving me issues.

LAxxxxxxxxx:CasperAPI username$ python CasperAPI_CLI.py unmanagecomputer xxxx Unmanaging computer xxxx... Traceback (most recent call last): File "CasperAPI_CLI.py", line 2006, in main() File "CasperAPI_CLI.py", line 1939, in main unmanageComputer(computerID, user, password) File "CasperAPI_CLI.py", line 1335, in unmanageComputer response = sendAPIRequest(putStr, username, password, 'PUT', putXML) File "CasperAPI_CLI.py", line 121, in sendAPIRequest response = urllib2.urlopen(request, XML)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open response = self._open(req, data) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open '_open', req) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain result = func(*args) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1240, in https_open context=self._context) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1197, in do_open raise URLError(err) urllib2.URLError: <urlopen error [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590)>

jkuo-eb commented 5 years ago

Hi @hpanwar2 - what version of macOS are you using? That could be an error related to an old TLS version on your version of macOS.

You'll probably need TLS version 1.2 to be able to connect to your JSS.

hpanwar2 commented 5 years ago

Thanks for your quick reply. I am running Mac OS High Sierra 10.13.6 Regarding the TLS version i believe its TLS V1.2 as when i run "curl https://google.com/ --tlsv1.2 --verbose" command in terminal i get below result.

curl https://google.com/ --tlsv1.2 --verbose

jkuo-eb commented 5 years ago

It looks like Ben had a similar issue, and had to explicitly enter the port number in the url during the setup for this to work. (I have it working on Jamf Cloud).

https://github.com/eventbrite/Casper-API-Tools/issues/1

Maybe try that?

Thanks.

hpanwar2 commented 5 years ago

Thanks for the update, i did follow the steps suggested to ben, nothing really work i can run python CasperAPI_CLI.py -h however nothing apart from this. i have reset up the whole process and used :8443 after the JSS url also put sudo in bash_profile. I am getting the same error