New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSL Cert Verification Error When Logging into MyPlex #341
Comments
I can confirm that I have a similar issue with my installation. I'm also using FreeBSD with the current master (17197c2) and the versions bellow. # python -V
Python 2.7.9
# python -c 'import ssl; print ssl.OPENSSL_VERSION'
OpenSSL 0.9.8za-freebsd 5 Jun 2014 This is my stacktrace: 00:12:08 WebServer: File Not Found:
Traceback (most recent call last):
File "/opt/PlexConnect/WebServer.py", line 229, in do_GET
XML = XMLConverter.XML_PMS2aTV(PMSaddress, self.path + query, options)
File "/opt/PlexConnect/XMLConverter.py", line 241, in XML_PMS2aTV
(username, auth_token) = PlexAPI.MyPlexSignIn(parts[0], parts[1], options)
File "/opt/PlexConnect/PlexAPI.py", line 598, in MyPlexSignIn
response = urlopener.open(request).read()
File "/usr/local/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/usr/local/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/usr/local/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/local/lib/python2.7/urllib2.py", line 1240, in https_open
context=self._context)
File "/usr/local/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)
URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)> This is what happens when i try to login to my Plex account in my Apple TV. It can discover the Plex server but I cant by any means login to the Plex account. It does not matter what i write in the login form, I will always get the above stacktrace. I'm not really familiar with python so I can't really say that my fix is the way to go but I managed to bypass the issue by adding |
@freestream You're great ! It works :) |
Hello, Thks for sharing. Valyno |
@valyno I hope this helps you. I guess you have a different version than the one I have. Line 32-38
Line 362-405
|
@freestream thank you for your help, I will have a look!! |
This is a couple months later. However, thank you. Same python version, same ssl version, same freebsd. I found I had a couple of differences in the code you suggested, but I went with your knowledge over my version. I was able to login without any grief after editing the PexAPI.py file to make the sections match. The second grouping was further down than in your range, but was easy enough to find based on the section lead. |
When attempting to sign into my PlexPass account through PlexConnect, my AppleTV spins and spins and I see the following stack trace on my server running PlexConnect.
Stack Trace:
16:24:32 WebServer: File Not Found:
Traceback (most recent call last):
File "/usr/local/taku/PlexConnect/WebServer.py", line 229, in do_GET
XML = XMLConverter.XML_PMS2aTV(PMSaddress, self.path + query, options)
File "/usr/local/taku/PlexConnect/XMLConverter.py", line 241, in XML_PMS2aTV
(username, auth_token) = PlexAPI.MyPlexSignIn(parts[0], parts[1], options)
File "/usr/local/taku/PlexConnect/PlexAPI.py", line 583, in MyPlexSignIn
response = urlopener.open(request).read()
File "/usr/local/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/usr/local/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/usr/local/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/local/lib/python2.7/urllib2.py", line 1240, in https_open
context=self._context)
File "/usr/local/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)
URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)>
OS: FreeBSD 10.1-STABLE
Python Version: 2.7.9
I suspect PlexAPI.py needs to be tweaked to allow for custom SSL settings, such as a bundled CA file. I'm more familiar with requests instead of urllib2, but https://docs.python.org/2/library/ssl.html#ssl.SSLContext.load_verify_locations in combination with the Mozilla CA cert (see the certifi wrapper - https://pypi.python.org/pypi/certifi/ ) would be a good start
The text was updated successfully, but these errors were encountered: