Can not claim server. (are there SSL issues for plex.tv?)

Server Version#: 1.32.4.7195

I noticed yesterday that my clients (plex on iOS, plexamp, web browser) had stopped seeing my local linux server.

I removed the attribute key pairs suggested in https://support.plex.tv/articles/204281528-why-am-i-locked-out-of-server-settings-and-how-do-i-get-in/

I then accessed the local web client address and could see the server, but when I click the “claim” button it briefly spins and returns to read “Claim Server”

In the logs I see:
HTTP error requesting POST https://plex.tv/api/claim/exchange?token=xxxxxxxxxxxxxxxxxxxxQLN-4q (60, SSL peer certificate or SSH remote key was not OK) (SSL: no alternative certificate subject name matches target host name ‘plex.tv’)

I tried curl-ing the addresses directly as suggested in Claim Server in a Ubuntu VM Not Working - #6 by pshanew

curl 52.18.248.32
→ returns Moved Permanently
curl 54.77.103.183
→ returns Moved Permanently
curl -L plex.tv
→ cursor flashes (eventually ended with ^C)
curl -L www.plex.tv
→ returns full web page

It looks to me that there is an issue with the SSL certificate for plex.tv?
If that is not the issue do you have suggestions for what I might try?

Need basic info please:

  • LAN IP of the server
  • LAN IP of your computer/workstation you’re using to access it.
  • is there a FQDN involved ? (curl error 60 implies there is another cert involved)

Server is 192.168.17.5
Workstation is also 192.168.17.5 (though I have tried on a laptop at 192.168.17.158)
No FQDN. The server/workstation name is bic, but no domain
Thanks!

First, please don’t get bogged down trying to understand attempting curl to plex.tv. It’s a very closed off URL which only responds when all the right pieces (info attached to the query) are present. Attempting ‘plain’ access will get you nothing.

As for getting the server reclaimed:

  1. You can talk to us here (presumably from 192.168.17.5) so the whole SSL mechanism is working correctly

  2. There have been cases where I’ve seen the “PlexOnlineToken” (in Preferences.xml) become a NULL value PlexOnlineToken="". They’re rare; yes it’s a race condition in PMS somewhere, and unfortunately we haven’t found it yet but still trying to.

  3. To reclaim your server, there are a couple options
    – Manual method - Edit Preferences.xml and use a manual CURL command
    – Semi automatic - Use a shell script which does the editing of Preferences.xml and CURL for you.

If you want to use the scripted/semi-automatic method, here’s the URL on github to what I wrote. (You’ll need be root - ‘sudo’ to run it)

If you want to do it manually:

  1. Edit Preferences.xml, removing the Name="value" pairs for:
    – PlexOnlineUsername
    – PlexOnineMail
    – PlexOnlineToken
    – PlexOnlineHome (if it exists)

  2. save Preferences.xml and start PMS. Let it sit there. Don’t touch it yet.

  3. Open https://plex.tv/claim

  4. COPY the claim-xxxxx token it gives you into your browser

  5. Now, within the next 4 minutes (the token expires)

curl -X POST  'http://127.0.0.1:32400/myplex/claim?token=PASTE_TOKEN_HERE'
  1. When you hit enter, it will sit there a bit as PMS and Plex.tv negotiate new credentials for the server.

  2. When it’s done, it will spit out a whole bunch of XML which ends with </MyPlex>

  3. These are all your server’s “feature flags”

  4. Now open the server up using the loopback adapter (http://127.0.0.1:32400/web)

  5. Sign in. Click ‘Got It’ if presented.

  6. If the wizard starts, Confirm your existing library sections - don’t create new.

  7. Set any other prefences you want along the way.

  8. You’ll Finish and end up at the dashboard with server claimed again.

The script if you want to use it:

My Preferences.xml did have the PlexOnlineToken=“” so stopped PMS, removed that pair, and restarted PMS. The other three pairs were not present.
I got the claim code, but running the curl command (both as plex and root users) and got a 500 error code. Here is the exact command and output:

plex@bic:~$ curl -X POST  'http://127.0.0.1:32400/myplex/claim?token=claim-xxxxxxxxxxxxxxxxxxxx'
<html><head><title>Internal Server Error</title></head><body><h1>500 Internal Server Error</h1></body></html>

I put x’s in place of the claim code because I’m not sure if it is specific to my source IP, etc.

I checked my Preferences.xml afterwards and the PlexOnlineToken=“” was back in there.
I made sure that I did not have any browser tabs open to the local web client
I also tried with my local IP in place of 127.0.0.1 in case there was any difficulty with the loopback, but the behaviour was identical.

Suggestions?

I tried testing the connection directly with curl using a portion of the command in the github shell script and got this:

plex@bic:~$ curl -X POST https://plex.tv/api/claim/exchange?token=claim-xxxxxxxxxxxxxxxxxxxx
curl: (60) SSL: no alternative certificate subject name matches target host name 'plex.tv'
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

You can’t use HTTPS to bootstrap the TLS (secure) connection. That’s why the CURL error 60

Using isolated commands from the shell script won’t work.

It need the entire boostrap sequence. (This is all stuff Plex/web - PMS do behind the scenes.

I recommend running the script, as countless have already done, as is.
Follow its instructions.

I stopped PMS, elevated to root, and ran. Here is the command and output (again with x’s instead of the real code).
Appears to be the same issue?

root@bic:~# ./UserCredentialReset.sh 
 
          Plex Media Server user credential reset and reclaim tool (Ubuntu 22.04.2 LTS)
 
This utility will reset the server's credentials.
It will next reclaim the server for you using a Plex Claim token you provide from https://plex.tv/claim
 
Please enter Plex Claim Token copied from http://plex.tv/claim : claim-xxxxxxxxxxxxxxxxxxxx
Clearing Preferences.xml
Getting new credentials from Plex.tv
ERROR: Could not get credentials from plex.tv (Error: 60)

What should I change?

WTH is going on with your network?

May I send you a PM?

Yes, please!

In case anyone else is looking at this thread in the future, ChuckPa and I tried several things to no avail.
The next morning (and following a router reboot) I was able to claim the server.
Mysterious.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.