Need help with Plex Component

I had the plex component working over a year and a half ago, but had other issues and put home assistant aside. I’ve since come back committed and got a lot of stuff setup and working smoothly, but I am no longer able to get my Plex component to work.

I only have 1 server (on Nvidia Shield TV) with remote access, and working token (Plex sensor works great).

I have 2 error messages from my logs, but I’m confused by the issue and haven’t been able to find any helpful results when googling them. Anyone able to help shed some insight or suggestions? Both seem to indicate an SSL certificate issue… I have tried adjusting all the settings in plex.conf and have tried every combo but nothing has resulted in the component working.

Wed Apr 17 2019 14:30:20 GMT-0600 (Mountain Daylight Time)

Certificate did not match expected hostname: 192.168.86.111. Certificate: {'subject': ((('commonName', '*.9e7bf00db4a7436e8a9e945dde33fc3d.plex.direct'),),), 'subjectAltName': [('DNS', '*.9e7bf00db4a7436e8a9e945dde33fc3d.plex.direct')]}

Wed Apr 17 2019 14:30:21 GMT-0600 (Mountain Daylight Time)
Error while setting up platform plex
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 839, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 364, in connect
    _match_hostname(cert, self.assert_hostname or server_hostname)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 374, in _match_hostname
    match_hostname(cert, asserted_hostname)
  File "/usr/local/lib/python3.7/ssl.py", line 327, in match_hostname
    % (hostname, dnsnames[0]))
ssl.SSLCertVerificationError: ("hostname '192.168.86.111' doesn't match '*.9e7bf00db4a7436e8a9e945dde33fc3d.plex.direct'",)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='192.168.86.111', port=32400): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError("hostname '192.168.86.111' doesn't match '*.9e7bf00db4a7436e8a9e945dde33fc3d.plex.direct'")))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/plex/media_player.py", line 96, in setup_platform
    hass, config, add_entities_callback
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/plex/media_player.py", line 115, in setup_plexserver
    token, cert_session
  File "/usr/local/lib/python3.7/site-packages/plexapi/server.py", line 102, in __init__
    data = self.query(self.key, timeout=timeout)
  File "/usr/local/lib/python3.7/site-packages/plexapi/server.py", line 341, in query
    response = method(url, headers=headers, timeout=timeout, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='192.168.86.111', port=32400): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError("hostname '192.168.86.111' doesn't match '*.9e7bf00db4a7436e8a9e945dde33fc3d.plex.direct'")))

Thank you!

Disable the ssl check, i think there was an option for it. I can also recall there was a little line somewhere that said you have to use the dns name and not the ip in order for it to work.

I have the same problem. I disabled the ssl check, and used the dns name, and still no luck.