Remote acess and secure connection

Server Version#: 1.19.5.3112 (installed with snap)
Player Version#: 4.34.3 (web)

I’ve had my server for many years, but recently moved and changed ISP. At first I didn’t have any problems, but now I can’t reach my plex server from outside my home network anymore, and I can’t figure out why.

When accessing the plexserver with browser (Firefox) via home network it claims to be visible from outside, but it’s not found when I log in to plex.tv. My NvidiaShield has no problems accessing on home network. When typing in the router ip and port number, I can connect, but not securely. Friends can’t connect. So I’m assuming now that it’s a problem with the secure certificates, but I really don’t know.

My plex server is installed on a headless ubuntu server. To make sure it wasn’t the routers fault, I bought a new one, a TP-Link m9 mesh thing. It only has two ports, so now I’ve switch in between router and server. Have set port forward for plex. Have checked that the port is accessible with some online tool. Also have a fixed ip for the router. Oh, and I changed the dns to 8.8.8.8, but that didn’t help either, both on the router and on server. Have of course rebooted router and server several times.

Now I really don’t know how to resolve this, and I’m hoping for some help.

It sounds like you’re doing the right things. Can you show some of your work?

Port forwarding settings in the router.
Remote Access settings in Plex.
Network settings in Plex.

From a device while not on your network i.e. mobile phone or laptop on some public WiFi browse to https://x.x.x.x:32400 assuming you use port 32400 and see what you get, x.x.x.x being your public IP.

I’m using port another port, but what I get is, well it’s in swedish… translated something like:
Connection terminated (aborted?) The browser could connect, but the connection was terminated while transfering information. Try again.

what ever that means :frowning:

but it I use http:// instead, I can connect.

What about https://y.y.y.y and replace y.y.y.y with your internal IP and do this test from inside your network.

https://192.168.1.112:32400

“secure connection failed”

Can you try to sign out of Plex on your server and sign back in?

signed out from the server and back in, and also had to “claim” it. Also logged out from the web-client and back in. No luck. On https://app.plex.tv/ I get “can’t make a secure connection. learn more about it here”. Think I have tried all the suggestions following that link.

Btw, I can make a secure connection to my friends server, be he can’t make one to mine.

I can’t post pictures of it atm, but I followed the instructions and suggestions here :https://support.plex.tv/articles/206225077-how-to-use-secure-server-connections/

From a command line on your Ubuntu server (ssh into it) run this command and post the output.

curl https://127.0.0.1:32400 -v -k

and replace 32400 with whatever port you are using.

then I get this:

  • Rebuilt URL to: https://127.0.0.1:32400/
  • Trying 127.0.0.1…
  • TCP_NODELAY set
  • Connected to 127.0.0.1 (127.0.0.1) port 32400 (#0)
  • ALPN, offering h2
  • ALPN, offering http/1.1
  • successfully set certificate verify locations:
  • CAfile: /etc/ssl/certs/ca-certificates.crt
    CApath: /etc/ssl/certs
  • TLSv1.3 (OUT), TLS handshake, Client hello (1):
  • OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to 127.0.0.1:32400
  • stopped the pause stream!
  • Closing connection 0
    curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to 127.0.0.1:32400

And that same command with http instead of https results in valid output?

In Settings -> Network, what do you have configured for:

Secure connections (should be “Preferred”)
Custom certificate location (should be empty)
Custom certificate encryption key (should be empty)
Custom certificate domain (should be empty)

Your curl output makes it look like Secure connections are disabled. I think you might get the same behavior if Plex can’t write to the Plexdata/Cache directory to manage the certificate.

thank you for your time on this!
Settings are as follows

Checked - support for IPv6
Secure connection (preferred) - tried toggling this back and forth, but no luck
custom certificate options (empty) (all three)
Not checked - Disable weak TLS versions
Checked - Aktivera lokal nätverksidentifiering (GDM)
Checked - Behandla WAN IP som LAN-bandbredd
Checked - Enable Relay
the last two fields are empty
Checked Webhooks

thank you for your help

http instead of https gives

curl http://127.0.0.1:32400 -v -k

  • Rebuilt URL to: http://127.0.0.1:32400/
  • Trying 127.0.0.1…
  • TCP_NODELAY set
  • Connected to 127.0.0.1 (127.0.0.1) port 32400 (#0)

GET / HTTP/1.1
Host: 127.0.0.1:32400
User-Agent: curl/7.58.0
Accept: /

< HTTP/1.1 401 Unauthorized
< X-Plex-Protocol: 1.0
< Content-Length: 193
< Content-Type: text/html
< Connection: close
< Cache-Control: no-cache
< Date: Sun, 16 Aug 2020 08:31:27 GMT
<

  • Closing connection 0
Unauthorized

401

but I don’t really understand these different outputs… what do they tell?

so, this can be a permissions thing? How could I check that?

I might first try disabling IPv6. Unless you know that you need it, turn it off and restart PMS. It’s a long shot, but if IPv6 isn’t working, I wonder if it’s preventing Plex from getting an SSL cert.

The other network settings sound good.

Do you know where to find the the Plexdata directory on your system?

It would be interesting to look at permissions of the Cache directory, and the ca.crt and certificate.p12 files. I think Plex would be very broken if it couldn’t write to the Cache directory, but …

The difference in the curl output is that it failed with https, and succeeded with http. It mostly confirmed what you were already describing - but it did so from the server, and eliminated Firefox and your local network and your PC from the equation.

Next I would ask for the logs. :slight_smile:

From the curl https ...

That’s OpenSSL saying that SSL failed, was a no-go, couldn’t connect.

From the curl http ...

That was actually a “success”, from the perspective of this test. It means that curl was able to establish a connection and make a request and get a response.

Disabled ipv6, restarted with snap restart, but no change.

No, I’m not sure where to find the plexdata directory, nor the cache. My linux-knowledge is a bit poor.

I’m also not sure how to go about the logs. I found I can download plex server logs as a zip file, that’s it?

I wasn’t super optimistic about disabling IPv6, but it was an easy thing to try. :slight_smile:

I think that link includes “where to find it” if you installed from the Snap package.

I’d like to see the output of “ls -la /path/to/plexdata/Cache/”.

It might be this, but I haven’t used the Snap packages: ls -la "/var/snap/plexmediaserver/common/Library/Application Support/Cache"

Yes, that will work.