Failed to connect to HTTPS on xxx.xxx.x.xx port 443: [SSL] PEM lib (_ssl:2525)

Hi Guys,

 

I've spent all day trying to find a solution to an issue I am having connecting my AppleTV 3 to Plex.

 

When I run my PlexConnect.py it all connects fine until the last line I get this Failed to connect to HTTPS on 192.168.1.71 port 443: [SSL] PEM lib (_ssl:2525)

 

If anyone could help me sort this issue I would be very grateful.

 

Thanks

Please read the “Read Before Posting” pinned thread and post all the information asked for in the how to report a problem section, including the log and settings file. But I would say do you have anything using port 443 on that machine?

Oh right sorry, my bad. I'm not sure, not that I know of. Kind of why I came here for some advice. I've followed all the install instruction and tutorials I could find. This seems to be the last little issue stopping it working. :(

Just checked and nothing is using 443

Also found the error log now:

01:04:24 PlexConnect: started: 01:04:24
01:04:24 PlexConnect: Version: 0.5-dev
01:04:24 PlexConnect: Python: 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)]
01:04:24 PlexConnect: Host OS: win32
01:04:24 PlexConnect: PILBackgrounds: Is PIL installed? False
01:04:24 PlexConnect: IP_self: 192.168.1.71
01:04:24 DNSServer: started: 01:04:24
01:04:24 DNSServer: ***
01:04:24 DNSServer: DNSServer: Serving DNS on 192.168.1.71 port 53.
01:04:24 DNSServer: ***
01:04:24 WebServer: started: 01:04:24
01:04:24 WebServer: ***
01:04:24 WebServer: WebServer: Serving HTTP on 192.168.1.71 port 80.
01:04:24 WebServer: ***
01:04:24 WebServer: started: 01:04:24
01:04:24 WebServer: Failed to connect to HTTPS on 192.168.1.71 port 443: [SSL] PEM lib (_ssl.c:2525)

Har you generated the certificates and put the files into the certificates folder specified in your settings.cfg file (default is assets/certificates from memory)

Yes did all that and just get that failed to connect to https message :(

Running as admin/with elevated rights?

Anything else on :443?

Yes, running as admin and pretty sure there isn't anything else on 443

When i probe the port it says its in stealth, would this then suggest something else is using port 443?

Thanks

01:04:24 PlexConnect: PILBackgrounds: Is PIL installed? False

I'm not 100% familiar with a Windows configuration, but you didn't install es the Pillow?

@Rolfey22 - Hello! Did installing the Pillow make any difference? Have you solved your issue?

Pillow is only used for Fanart/Background preprocessing. It is not necessarily needed for the basic PlexConnect functionality.

Pillow is only used for Fanart/Background preprocessing. It is not necessarily needed for the basic PlexConnect functionality

Thanks for the info, I didn't know what it was. Today is my first time venturing out into the world of PlexConnect. I happen to have the SAME exact problem as Rolfey22. Hoping to piggyback off of his issue, maybe it will help me solve mine. :) 

Having Similar issues - I tried connecting to host through said port in Telnet and still can't connect....

Here's my PlexConnect.py log:

12:05:18 PlexConnect: started: 12:05:18
12:05:18 PlexConnect: Version: 0.5-dev
12:05:18 PlexConnect: Python: 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)]
12:05:18 PlexConnect: Host OS: win32
12:05:18 PlexConnect: PILBackgrounds: Is PIL installed? False
12:05:18 PlexConnect: IP_self: 10.5.249.244
12:05:18 DNSServer: started: 12:05:18
12:05:18 DNSServer: ***
12:05:18 DNSServer: DNSServer: Serving DNS on 10.5.249.244 port 53.
12:05:18 DNSServer: ***
12:05:18 WebServer: started: 12:05:18
12:05:18 WebServer: ***
12:05:18 WebServer: WebServer: Serving HTTP on 10.5.249.244 port 80.
12:05:18 WebServer: ***
12:05:19 WebServer: started: 12:05:19
12:05:19 WebServer: Failed to connect to HTTPS on 10.5.249.244 port 443: [SSL] PEM lib (_ssl.c:2525)

Any suggestions?
 

I had the same problem and the fix for me was really simple. If you got the certification code from LANGUI.SH (https://langui.sh/2013/08/27/appletv-ssl-plexconnect/) there is an error in the code. The line "C:\OpenSSL-Win32\bin\openssl.exe x509 -in C: railers.pem -outform der -out C: railers.der" should be "C:\OpenSSL-Win32\bin\openssl.exe x509 -in C: railers.pem -outform der -out C: railers.cer". If you notice the file type in his code is incorrectly ".der" when it should be ".cer". I remade the certificate with the code from the GitHub page (https://github.com/iBaa/PlexConnect/wiki/Install-Guide-Windows-Certificates) and it worked like a charm. Hopefully this helps.

If you run PlexConnect and the error is gone you are good to go, except you need to get that same certificate onto your aTV. Either by transferring via USB and iPhone Configuration Utility or adding the profile to the aTV itself. You can see how to do that in this video if you need help. 

https://www.youtube.com/watch?v=1Tu_ax-99gY

Sorry this got kind of long, but hopefully it helps you or someone else get PlexConnect working.

Trailers

WSJ

iMovie

Take your pick they should be good for 10 years. I made em on a unused PlexConnect Host I only use to test with. If you use them load them like this for example I load mine like:

192.168.1.101/trailers.cer

Just put your local ip in place of mine and follow this to load your certs:

https://www.youtube.com/watch?v=PvyQhwYfECE

Having similar issues as the OP.  Used all the suggestions mentioned above.  Using the plexconnectip/trailers.cer instead of the http://trailers.apple.com/trailers.cerwhile adding the profile on ATV 3. The latter gives :Unable to add profile" type of error message.  The log is attached below.  ANy help would be highly appreciated.

14:55:17 PlexConnect: started: 14:55:17
14:55:17 PlexConnect: Version: 0.5-dev
14:55:17 PlexConnect: Python: 2.7.9 (default, Dec 10 2014, 12:28:03) [MSC v.1500 64 bit (AMD64)]
14:55:17 PlexConnect: Host OS: win32
14:55:17 PlexConnect: PILBackgrounds: Is PIL installed? False
14:55:17 Settings: getsetting enable_plexconnect_autodetect=True
14:55:17 PlexConnect: IP_self: 192.168.1.6
14:55:17 Settings: getsetting hosttointercept=trailers.apple.com
14:55:17 Settings: getsetting enable_dnsserver=True
14:55:17 DNSServer: started: 14:55:17
14:55:17 Settings: getsetting port_dnsserver=53
14:55:17 Settings: getsetting ip_dnsmaster=192.168.1.1
14:55:17 Settings: getsetting prevent_atv_update=True
14:55:17 DNSServer: ***
14:55:17 DNSServer: DNSServer: Serving DNS on 192.168.1.6 port 53.
14:55:17 DNSServer: intercept: ['trailers.apple.com'] => 192.168.1.6
14:55:17 DNSServer: restrain: ['mesu.apple.com', 'appldnld.apple.com', 'appldnld.apple.com.edgesuite.net'] => 127.0.0.1
14:55:17 DNSServer: forward other to higher level DNS: 192.168.1.1
14:55:17 DNSServer: ***
14:55:17 WebServer: started: 14:55:17
14:55:17 Settings: getsetting port_webserver=80
14:55:17 Settings: getsetting enable_webserver_ssl=True
14:55:17 WebServer: ***
14:55:17 WebServer: WebServer: Serving HTTP on 192.168.1.6 port 80.
14:55:17 WebServer: ***
14:55:17 WebServer: started: 14:55:17
14:55:17 Settings: getsetting port_ssl=443
14:55:17 Settings: getsetting certfile=./assets/certificates/trailers.pem
14:55:17 Settings: getsetting certfile=./assets/certificates/trailers.pem
14:55:18 WebServer: Failed to connect to HTTPS on 192.168.1.6 port 443: [SSL] PEM lib (_ssl.c:2525)

How about #14?

If you have installed Python 2.7.9, than remove it and install 2.7.8, because python 2.7.9 they now validate ssl certs by default. 

I had this problem too. It's a problem with the certificates you generated (or downloaded if that's your thing).

In assets/certificates there is a file called certificates.txt that gives the exact commands you need to run. This is what I did on my Ubuntu 15.04 box (copy/paste from the MAC section in certificates.txt):

cd /usr/local/PlexConnect/assets/certificates

openssl req -new -nodes -newkey rsa:2048 -out trailers.pem -keyout trailers.key -x509 -days 365 -subj "/C=US/CN=trailers.apple.com"

openssl x509 -in trailers.pem -outform der -out trailers.cer && cat trailers.key >> trailers.pem

cd ../..

sudo ./PlexServer.py

Haven't tried the next stage of getting the certificate onto the ATV3, but crossing fingers! 

Hope this helps :)

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