Jump to content

Direct streaming over HTTPS stops playing randomly


fc7

Recommended Posts

Hi guys,

 

Tonight while playing a TV show using Emby addon, with direct streaming over HTTPS from Emby server, the playback stopped several  times and went back to the episode selection. This happened to me at least 4-5 times in a 1hr episode.

Waiting a few seconds and pressing <enter> on the episode, will resume playback most of the times but sometimes it will just restart playback from the beggining and I had to FF to the point when playback stopped.

 

Emby server version: 3.0.5713.2 (latest beta)

Emby Kodi addon version: 1.0.35

 

In the Kodi log I keep getting:

ERROR: /storage/.kodi/addons/script.module.requests/lib/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning

And everytime that playback stops:

ERROR: CCurlFile::FillBuffer - Failed: Timeout was reached(28)
NOTICE: CCurlFile::FillBuffer - Reconnect, (re)try 1
ERROR: CCurlFile::FillBuffer - Failed: Timeout was reached(28)
NOTICE: CCurlFile::FillBuffer - Reconnect, (re)try 2
ERROR: CCurlFile::FillBuffer - Failed: Timeout was reached(28)
ERROR: CCurlFile::FillBuffer - Reconnect failed!

I already checked on the server and transcoding is not in use at all but some errors are logged every time I start playback again.

2015-08-25 23:54:08.5992 Error - HttpServer: Error in ProcessAccept
	*** Error Report ***
	Version: 3.0.5713.2
	Command line: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe -programdata /var/lib/emby-server -restartpath /usr/lib/emby-server/restart.sh
	Operating system: Unix 3.10.0.229
	Processor count: 4
	64-Bit OS: True
	64-Bit Process: True
	Program data path: /var/lib/emby-server
	Mono: 4.0.1 (tarball Thu Jun 25 23:12:03 UTC 2015)
	Application Path: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe
	The authentication or decryption has failed.
	System.IO.IOException
	  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
	InnerException: System.IO.IOException
	Error while sending TLS Alert (Fatal:InternalError): System.IO.IOException: EndWrite failure ---> System.Net.Sockets.SocketException: The socket has been shut down
	  at System.Net.Sockets.Socket.EndSend (IAsyncResult result) [0x00000] in <filename unknown>:0 
	  at System.Net.Sockets.NetworkStream.EndWrite (IAsyncResult ar) [0x00000] in <filename unknown>:0 
	  --- End of inner exception stack trace ---
	  at System.Net.Sockets.NetworkStream.EndWrite (IAsyncResult ar) [0x00000] in <filename unknown>:0 
	  at Mono.Security.Protocol.Tls.RecordProtocol.EndSendRecord (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
	  at Mono.Security.Protocol.Tls.RecordProtocol.InternalSendRecordCallback (IAsyncResult ar) [0x00000] in <filename unknown>:0 
	InnerException: System.IO.IOException
	EndWrite failure
	  at System.Net.Sockets.NetworkStream.EndWrite (IAsyncResult ar) [0x00000] in <filename unknown>:0 
	  at Mono.Security.Protocol.Tls.RecordProtocol.EndSendRecord (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
	  at Mono.Security.Protocol.Tls.RecordProtocol.InternalSendRecordCallback (IAsyncResult ar) [0x00000] in <filename unknown>:0 
	InnerException: System.Net.Sockets.SocketException
	The socket has been shut down
	  at System.Net.Sockets.Socket.EndSend (IAsyncResult result) [0x00000] in <filename unknown>:0 
	  at System.Net.Sockets.NetworkStream.EndWrite (IAsyncResult ar) [0x00000] in <filename unknown>:0 
	
2015-08-25 23:54:08.6162 Error - HttpServer: Error in ProcessAccept
	*** Error Report ***
	Version: 3.0.5713.2
	Command line: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe -programdata /var/lib/emby-server -restartpath /usr/lib/emby-server/restart.sh
	Operating system: Unix 3.10.0.229
	Processor count: 4
	64-Bit OS: True
	64-Bit Process: True
	Program data path: /var/lib/emby-server
	Mono: 4.0.1 (tarball Thu Jun 25 23:12:03 UTC 2015)
	Application Path: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe
	The authentication or decryption has failed.
	System.IO.IOException
	  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
	InnerException: System.IO.IOException
	Error while sending TLS Alert (Fatal:HandshakeFailiure): Mono.Security.Protocol.Tls.TlsException: The client stopped the handshake.
	  at Mono.Security.Protocol.Tls.SslServerStream.EndNegotiateHandshake (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
	  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
	InnerException: Mono.Security.Protocol.Tls.TlsException
	The client stopped the handshake.
	  at Mono.Security.Protocol.Tls.SslServerStream.EndNegotiateHandshake (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
	  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
	
2015-08-25 23:54:18.8848 Error - NotFoundHttpHandler: 192.168.7.31:8920 Request not found: /Videos/405d54115b8702070151cc5aba2093a5/405d54115b8702070151cc5aba2093a5/Subtitles/2/Stream.srt
2015-08-25 23:57:02.4431 Error - HttpServer: Error in ProcessAccept
	*** Error Report ***
	Version: 3.0.5713.2
	Command line: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe -programdata /var/lib/emby-server -restartpath /usr/lib/emby-server/restart.sh
	Operating system: Unix 3.10.0.229
	Processor count: 4
	64-Bit OS: True
	64-Bit Process: True
	Program data path: /var/lib/emby-server
	Mono: 4.0.1 (tarball Thu Jun 25 23:12:03 UTC 2015)
	Application Path: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe
	The authentication or decryption has failed.
	System.IO.IOException
	  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
	InnerException: System.IO.IOException
	Error while sending TLS Alert (Fatal:InternalError): System.IO.IOException: EndWrite failure ---> System.Net.Sockets.SocketException: The socket has been shut down
	  at System.Net.Sockets.Socket.EndSend (IAsyncResult result) [0x00000] in <filename unknown>:0 
	  at System.Net.Sockets.NetworkStream.EndWrite (IAsyncResult ar) [0x00000] in <filename unknown>:0 
	  --- End of inner exception stack trace ---
	  at System.Net.Sockets.NetworkStream.EndWrite (IAsyncResult ar) [0x00000] in <filename unknown>:0 
	  at Mono.Security.Protocol.Tls.RecordProtocol.EndSendRecord (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
	  at Mono.Security.Protocol.Tls.RecordProtocol.InternalSendRecordCallback (IAsyncResult ar) [0x00000] in <filename unknown>:0 
	InnerException: System.IO.IOException
	EndWrite failure
	  at System.Net.Sockets.NetworkStream.EndWrite (IAsyncResult ar) [0x00000] in <filename unknown>:0 
	  at Mono.Security.Protocol.Tls.RecordProtocol.EndSendRecord (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
	  at Mono.Security.Protocol.Tls.RecordProtocol.InternalSendRecordCallback (IAsyncResult ar) [0x00000] in <filename unknown>:0 
	InnerException: System.Net.Sockets.SocketException
	The socket has been shut down
	  at System.Net.Sockets.Socket.EndSend (IAsyncResult result) [0x00000] in <filename unknown>:0 
	  at System.Net.Sockets.NetworkStream.EndWrite (IAsyncResult ar) [0x00000] in <filename unknown>:0 
	
2015-08-25 23:57:02.4630 Error - HttpServer: Error in ProcessAccept
	*** Error Report ***
	Version: 3.0.5713.2
	Command line: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe -programdata /var/lib/emby-server -restartpath /usr/lib/emby-server/restart.sh
	Operating system: Unix 3.10.0.229
	Processor count: 4
	64-Bit OS: True
	64-Bit Process: True
	Program data path: /var/lib/emby-server
	Mono: 4.0.1 (tarball Thu Jun 25 23:12:03 UTC 2015)
	Application Path: /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe
	The authentication or decryption has failed.
	System.IO.IOException
	  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
	InnerException: System.IO.IOException
	Error while sending TLS Alert (Fatal:HandshakeFailiure): Mono.Security.Protocol.Tls.TlsException: The client stopped the handshake.
	  at Mono.Security.Protocol.Tls.SslServerStream.EndNegotiateHandshake (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
	  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
	InnerException: Mono.Security.Protocol.Tls.TlsException
	The client stopped the handshake.
	  at Mono.Security.Protocol.Tls.SslServerStream.EndNegotiateHandshake (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
	  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
	
2015-08-25 23:57:16.8627 Error - NotFoundHttpHandler: 192.168.7.31:8920 Request not found: /Videos/405d54115b8702070151cc5aba2093a5/405d54115b8702070151cc5aba2093a5/Subtitles/2/Stream.srt

Please note the subtitle stream error, but subs are working just fine.

The network is solid too, I'm using a wired connection. Plus I never have this kinds of problem before without using the Emby addon (direct NFS play), or using it with Emby addon direct play/local paths (using NFS too).

 

I don't have time to check direct stream over HTTP tonight but I will do it tomorrow to verify if the problem is in any way related to the protocol in use.

One last note: in the addon setting I had defined the IP address of the server to connect to, not the name, but the server certificate CN value holds the server fqdn instead. Maybe the HTTPS warning in Kodi logs but also on server logs is related to that?

 

Thanks in advance for your help.

kodi.log.gz

Edited by fc7
Link to post
Share on other sites
Angelblue05

I don't use HTTPS, I can tell you I don't have issues streaming over HTTP on Helix.

 

My HTTPS knowledge is very limited. If you are not using a self signed certificate, how are your https settings set in Kodi? Did you enable "Verify HOST SSL" in add-on settings?

Link to post
Share on other sites

I don't use HTTPS, I can tell you I don't have issues streaming over HTTP on Helix.

 

My HTTPS knowledge is very limited. If you are not using a self signed certificate, how are your https settings set in Kodi? Did you enable "Verify HOST SSL" in add-on settings?

 

I have my own Certification Authority, to create certificates for all my servers and users. This is more convinient for me because among other things it allows me to install my root CA certificate in all my clients and they will automatically trust all my certificates.

So I created a new certificate for my Emby server, using only the server internal FQDN as the Common Name.

 

The first problem I think I have that I will fix tonight is that in Kodi, on the server address I'm using the server IP, instead of the FQDN. This will create a trust issue since the certificate offered by the server only has the FQDN on the CN field and not the server IP. Fixing this is pretty easy, I need to change the server address in Kodi to point to the server FQDN. But sadly this will also require me to reset the library and get the paths changed  (IP replaced by FQDN).

 

To answer your second question I didn't enable "Verify HOST SSL" for two reasons:

  1. Because of the CN mismatch (Kodi expects server IP in the CN field, but server certificate is issued to server FQDN), and in this case Kodi shouldn't trust the server and deny the connection.
  2. I still don't know where should I put my root CA certificate that Kodi will need to actually verify that the server certificate is valid.

My current action plan is:

 

  1. Change the server address in the Emby addon, replacing server IP with server FQDN and do a library reset/resync.
  2. If with the previous change I still have issues, I will move to HTTP instead to discard any other issue not protocol related like a hardware problem, network problem, etc.
  3. If this works I will revert to HTTPS properly configuring it (including root CA certificate installation) and try again.

 

I will keep posting updates on this thread.

 

Cheers.

  • Like 1
Link to post
Share on other sites
Angelblue05

You can add it in the add-on settings. When you enable HTTPS, verify enabled and add Client side certificate > point to the PEM certificate.

  • Like 1
Link to post
Share on other sites

You can add it in the add-on settings. When you enable HTTPS, verify enabled and add Client side certificate > point to the PEM certificate.

 

Sweet. I will upload the root CA certificate to OpenELEC and follow your instructions.

 

Thanks

Link to post
Share on other sites

I've try to configure SSL correctly (adding the root CA certificate to Kodi, configuring the correct server name and checking the verify server option, to no avail. :(

 

I keep getting this error in the Kodi log:

ERROR: /storage/.kodi/addons/script.module.requests/lib/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
                                              InsecurePlatformWarning

I checked http://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning and it seems that I'm missing more stuff on OpenELEC like pyOpenSSL that is needed to work with certificates. I keep reading similar things on the Internet.

 

The only setting the currently works is to enable SSL but don't verify the certificate I guess this way Kodi will just accept whatever the server offers, don't do any certificate work and move on.

 

It feels like a dead end for me since I want to stick to OpenELEC and is very difficult to add software to it, or even upgrade the existing one.

 

I will switch now to HTTP and hopefully that will solve my playback issue.

Edited by fc7
Link to post
Share on other sites
Guest
This topic is now closed to further replies.
×
×
  • Create New...