jssimporter / python-jss

python-jss is deprecated. Please see the wiki for alternatives.
GNU General Public License v3.0
102 stars 41 forks source link

sslv3 alert handshake failure with JAMF Pro 10.6 #87

Closed liamshanny closed 5 years ago

liamshanny commented 6 years ago

We just updated our JAMF server to 10.6, and since then I haven't been able to get this library to run

Making the following call: jamf_xml = j.MobileDevice().retrieve_all(subset="general&location&mobiledevicegroups")

And I get the resulting exception: requests.exceptions.SSLError: HTTPSConnectionPool(host='ndh-jss-01.corp.contoso.com', port=8443): Max retries exceeded with url: /JSSResource/mobiledevices (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_read_bytes', 'sslv3 alert handshake failure')],)",),))

I have tried disabling ssl_verify in the JSS prefs, but the issue persists. Any ideas to further troubleshoot this?

danengh commented 5 years ago

I was able to get past this by modifying the ssl_version value in tlsadapter.py (/Library/Python/2.7/site-packages/jss/tlsadapter.py)

old: ssl_version=ssl.PROTOCOL_TLSv1

new: ssl_version=ssl.PROTOCOL_TLSv1_2

I did test it with the JSSImporter/autopkg and didn't see any issues. Did not test any further.

@sheagcraig

csanders-git commented 5 years ago

@danengh saved me 5 minutes of isolating that myself, thanks. For the record, if you have custom scripts using python-jss it will be in a different place than the version used by JSSImporter. The following locations were useful for me.

gkluoe commented 5 years ago

Thanks for tracking this one down! Fix above worked for me.

grahampugh commented 5 years ago

In case it helps anyone else, for me, the following location was the one that fixed it:

grahampugh commented 5 years ago

This is now merged into the master branch