maihde / roku_subsonic

Roku TV frontend for the Subsonic streaming music server
GNU General Public License v3.0
21 stars 7 forks source link

server address problems #23

Open bradbulger opened 8 years ago

bradbulger commented 8 years ago

The first problem is that there is a size limit of 30 characters on the length of the server URL. Too short.

When I tried using the IP address instead, it still had problems ("Error connecting to server" or whatever the exact wording). This is to an HTTPS address and it may be sticking on the certificate, I don't know.

I'm able to use the original URL in a Subsonic app in Android.

maihde commented 8 years ago

The size limit is an easy fix, I will increase that. I'll also investigate potential reasons for HTTPS to fail.

In either case I'll respond here when I have a candidate build that you can test with.

~Michael

On Tue, Jul 21, 2015 at 5:36 PM, bradbulger notifications@github.com wrote:

The first problem is that there is a size limit of 30 characters on the length of the server URL. Too short.

When I tried using the IP address instead, it still had problems ("Error connecting to server" or whatever the exact wording). This is to an HTTPS address and it may be sticking on the certificate, I don't know.

I'm able to use the original URL in a Subsonic app in Android.

— Reply to this email directly or view it on GitHub https://github.com/maihde/roku_subsonic/issues/23.

bradbulger commented 8 years ago

OK. I will try some other server addresses, I may be able to find out more specifics.

On Wed, Jul 22, 2015 at 12:38 PM, maihde notifications@github.com wrote:

The size limit is an easy fix, I will increase that. I'll also investigate potential reasons for HTTPS to fail.

In either case I'll respond here when I have a candidate build that you can test with.

~Michael

On Tue, Jul 21, 2015 at 5:36 PM, bradbulger notifications@github.com wrote:

The first problem is that there is a size limit of 30 characters on the length of the server URL. Too short.

When I tried using the IP address instead, it still had problems ("Error connecting to server" or whatever the exact wording). This is to an HTTPS address and it may be sticking on the certificate, I don't know.

I'm able to use the original URL in a Subsonic app in Android.

— Reply to this email directly or view it on GitHub https://github.com/maihde/roku_subsonic/issues/23.

— Reply to this email directly or view it on GitHub https://github.com/maihde/roku_subsonic/issues/23#issuecomment-123820890 .

bradbulger commented 8 years ago

I can't connect to any HTTPS server, but I don't have access to any installations that don't have some issue with the certificate (self-issued, etc). So I can't confirm if it works with a perfectly valid HTTPS URL. It'd be nice if it would be more forgiving, though. Other clients - browsers, Android apps, so on - are able to handle these URLs.

On Wed, Jul 22, 2015 at 1:23 PM, Brad Bulger bradbulger@gmail.com wrote:

OK. I will try some other server addresses, I may be able to find out more specifics.

On Wed, Jul 22, 2015 at 12:38 PM, maihde notifications@github.com wrote:

The size limit is an easy fix, I will increase that. I'll also investigate potential reasons for HTTPS to fail.

In either case I'll respond here when I have a candidate build that you can test with.

~Michael

On Tue, Jul 21, 2015 at 5:36 PM, bradbulger notifications@github.com wrote:

The first problem is that there is a size limit of 30 characters on the length of the server URL. Too short.

When I tried using the IP address instead, it still had problems ("Error connecting to server" or whatever the exact wording). This is to an HTTPS address and it may be sticking on the certificate, I don't know.

I'm able to use the original URL in a Subsonic app in Android.

— Reply to this email directly or view it on GitHub https://github.com/maihde/roku_subsonic/issues/23.

— Reply to this email directly or view it on GitHub https://github.com/maihde/roku_subsonic/issues/23#issuecomment-123820890 .

maihde commented 8 years ago

Brad,

I agree with your sentiment. If you are intrepid and willing to try a bit of Roku development; I believe that adding the following:

xfer.SetCertificatesFile ("common:/certs/ca-bundle.crt")

xfer.InitClientCertificates()

Everywhere you see an:

xfer = CreateObject("roURLTransfer")

Will probably fix it. I won't have time to get to this in the next couple of weeks, but I will take a look at fixing this and making a build with the increased URL length in late August.

~Michael

On Tue, Jul 28, 2015 at 9:30 PM, bradbulger notifications@github.com wrote:

I can't connect to any HTTPS server, but I don't have access to any installations that don't have some issue with the certificate (self-issued, etc). So I can't confirm if it works with a perfectly valid HTTPS URL. It'd be nice if it would be more forgiving, though. Other clients - browsers, Android apps, so on - are able to handle these URLs.

On Wed, Jul 22, 2015 at 1:23 PM, Brad Bulger bradbulger@gmail.com wrote:

OK. I will try some other server addresses, I may be able to find out more specifics.

On Wed, Jul 22, 2015 at 12:38 PM, maihde notifications@github.com wrote:

The size limit is an easy fix, I will increase that. I'll also investigate potential reasons for HTTPS to fail.

In either case I'll respond here when I have a candidate build that you can test with.

~Michael

On Tue, Jul 21, 2015 at 5:36 PM, bradbulger notifications@github.com wrote:

The first problem is that there is a size limit of 30 characters on the length of the server URL. Too short.

When I tried using the IP address instead, it still had problems ("Error connecting to server" or whatever the exact wording). This is to an HTTPS address and it may be sticking on the certificate, I don't know.

I'm able to use the original URL in a Subsonic app in Android.

— Reply to this email directly or view it on GitHub https://github.com/maihde/roku_subsonic/issues/23.

— Reply to this email directly or view it on GitHub < https://github.com/maihde/roku_subsonic/issues/23#issuecomment-123820890> .

— Reply to this email directly or view it on GitHub https://github.com/maihde/roku_subsonic/issues/23#issuecomment-125745424 .

bradbulger commented 8 years ago

OK. I did confirm that using an IP is a workaround to domain length, for HTTP URLs.

On Tue, Jul 28, 2015 at 4:14 PM, maihde notifications@github.com wrote:

Brad,

I agree with your sentiment. If you are intrepid and willing to try a bit of Roku development; I believe that adding the following:

xfer.SetCertificatesFile ("common:/certs/ca-bundle.crt")

xfer.InitClientCertificates()

Everywhere you see an:

xfer = CreateObject("roURLTransfer")

Will probably fix it. I won't have time to get to this in the next couple of weeks, but I will take a look at fixing this and making a build with the increased URL length in late August.

~Michael

On Tue, Jul 28, 2015 at 9:30 PM, bradbulger notifications@github.com

wrote:

I can't connect to any HTTPS server, but I don't have access to any installations that don't have some issue with the certificate (self-issued, etc). So I can't confirm if it works with a perfectly valid HTTPS URL. It'd be nice if it would be more forgiving, though. Other clients - browsers, Android apps, so on - are able to handle these URLs.

On Wed, Jul 22, 2015 at 1:23 PM, Brad Bulger bradbulger@gmail.com wrote:

OK. I will try some other server addresses, I may be able to find out more specifics.

On Wed, Jul 22, 2015 at 12:38 PM, maihde notifications@github.com wrote:

The size limit is an easy fix, I will increase that. I'll also investigate potential reasons for HTTPS to fail.

In either case I'll respond here when I have a candidate build that you can test with.

~Michael

On Tue, Jul 21, 2015 at 5:36 PM, bradbulger <notifications@github.com

wrote:

The first problem is that there is a size limit of 30 characters on the length of the server URL. Too short.

When I tried using the IP address instead, it still had problems ("Error connecting to server" or whatever the exact wording). This is to an HTTPS address and it may be sticking on the certificate, I don't know.

I'm able to use the original URL in a Subsonic app in Android.

— Reply to this email directly or view it on GitHub https://github.com/maihde/roku_subsonic/issues/23.

— Reply to this email directly or view it on GitHub < https://github.com/maihde/roku_subsonic/issues/23#issuecomment-123820890

.

— Reply to this email directly or view it on GitHub < https://github.com/maihde/roku_subsonic/issues/23#issuecomment-125745424> .

— Reply to this email directly or view it on GitHub https://github.com/maihde/roku_subsonic/issues/23#issuecomment-125768630 .

bradbulger commented 8 years ago

i tried that, didn't fix it. but having gotten into dev mode on the Roku, i can see the result code is -60, which i guess is the roUrlEvent error code? "CURLE_SSL_CACERT - problem with the CA cert (path?)"

bradbulger commented 8 years ago

adding these lines gets it past the connection test

xfer.SetCertificatesFile ("common:/certs/ca-bundle.crt")
xfer.AddHeader("X-Roku-Reserved-Dev-Id", "")
xfer.InitClientCertificates()
xfer.EnableHostVerification(false)
xfer.EnablePeerVerification(false)

it can get information about music files etc but not play them - no errors, it just starts a file and then stops like it's finished. ah well.

maihde commented 8 years ago

That is good news! That means that you if you make one more change things will probably start working.

Around line 575 you will find this:

m.audioPlayer = CreateObject("roAudioPlayer")

Then add:

m.audioPlayer.SetCertificatesFile ("common:/certs/ca-bundle.crt") m.audioPlayer.AddHeader("X-Roku-Reserved-Dev-Id", "") m.audioPlayer.InitClientCertificates()

The roAudioPlayer object does not include an EnableHostVerification() or EnablePeerVerfication() methods.

Give that a try and let me know how it works.

On Fri, Aug 7, 2015 at 5:58 PM, bradbulger notifications@github.com wrote:

adding these lines gets it past the connection test

xfer.SetCertificatesFile ("common:/certs/ca-bundle.crt") xfer.AddHeader("X-Roku-Reserved-Dev-Id", "") xfer.InitClientCertificates() xfer.EnableHostVerification(false) xfer.EnablePeerVerification(false)

it can get information about music files etc but not play them - no errors, it just starts a file and then stops like it's finished. ah well.

— Reply to this email directly or view it on GitHub https://github.com/maihde/roku_subsonic/issues/23#issuecomment-128765660 .

bradbulger commented 8 years ago

I tried that. I think at this point I am where I originally wanted to be, which is testing the app to see if it would work for me. My server is actually a madsonic server, not subsonic, and many of the files are FLAC. I've tried playing MP3 files specifically in case that was an issue, but still no joy. The relevant roAudioPlayerEvent messages look to be "Unspecified or invalid track path/url." and "The format is not supported or the media is corrupt."

i tried another server that is Subsonic but also at an HTTPS URL. trying to play an MP3 file there i still get the "Unspecified or invalid track/path url." message. this is another case where the cert has issues.

i tried removing all of the cert-related lines, only leaving the verfication disabling commands, and everything is the same. i don't have a server with a valid SSL cert to test to confirm, but it looks like that's the real problem.

however, there is this node in the SDK docs:

"Note that you cannot successfully access the video until you've built a package, uploaded it to the channel store, and are running that channel via a channel code. A side-loaded developer app does not properly negotiate client certs or send the enforced dev-id value for the x-roku-reserved-dev-id header."

so who knows :)

On Sun, Aug 9, 2015 at 10:07 AM, maihde notifications@github.com wrote:

That is good news! That means that you if you make one more change things will probably start working.

Around line 575 you will find this:

m.audioPlayer = CreateObject("roAudioPlayer")

Then add:

m.audioPlayer.SetCertificatesFile ("common:/certs/ca-bundle.crt") m.audioPlayer.AddHeader("X-Roku-Reserved-Dev-Id", "") m.audioPlayer.InitClientCertificates()

The roAudioPlayer object does not include an EnableHostVerification() or EnablePeerVerfication() methods.

Give that a try and let me know how it works.

On Fri, Aug 7, 2015 at 5:58 PM, bradbulger notifications@github.com wrote:

adding these lines gets it past the connection test

xfer.SetCertificatesFile ("common:/certs/ca-bundle.crt") xfer.AddHeader("X-Roku-Reserved-Dev-Id", "") xfer.InitClientCertificates() xfer.EnableHostVerification(false) xfer.EnablePeerVerification(false)

it can get information about music files etc but not play them - no errors, it just starts a file and then stops like it's finished. ah well.

— Reply to this email directly or view it on GitHub < https://github.com/maihde/roku_subsonic/issues/23#issuecomment-128765660>

.

— Reply to this email directly or view it on GitHub https://github.com/maihde/roku_subsonic/issues/23#issuecomment-129207686 .

maihde commented 8 years ago

So the X-Roku-Reserved-Dev-Id is not related to SSL/HTTPs. I just happened to copy-paste it from other code I had that uses HTTPs successfully.

I'll happily add all of those changes and publish it so you can install a version directly. As the SDK note mentions, perhaps that will work, but my guess is that the self-signed certificate might be the issue.

What I used to do (years back) was to run my server in Jetty with both HTTP and HTTPS. The HTTP was only for the internal home network while the HTTPS was available externally (via port-forwarding on my router). While this solution isn't as good as getting the Roku to work with your HTTPS certificate...it might come to that if we reach an impasse where the Roku firmware just doesn't support what we need.

Thanks for helping debug the issue. I've been very busy and haven't had time to setup my own HTTPS server here for testing yet.

On Sun, Aug 9, 2015 at 7:43 PM, bradbulger notifications@github.com wrote:

I tried that. I think at this point I am where I originally wanted to be, which is testing the app to see if it would work for me. My server is actually a madsonic server, not subsonic, and many of the files are FLAC. I've tried playing MP3 files specifically in case that was an issue, but still no joy. The relevant roAudioPlayerEvent messages look to be "Unspecified or invalid track path/url." and "The format is not supported or the media is corrupt."

i tried another server that is Subsonic but also at an HTTPS URL. trying to play an MP3 file there i still get the "Unspecified or invalid track/path url." message. this is another case where the cert has issues.

i tried removing all of the cert-related lines, only leaving the verfication disabling commands, and everything is the same. i don't have a server with a valid SSL cert to test to confirm, but it looks like that's the real problem.

however, there is this node in the SDK docs:

"Note that you cannot successfully access the video until you've built a package, uploaded it to the channel store, and are running that channel via a channel code. A side-loaded developer app does not properly negotiate client certs or send the enforced dev-id value for the x-roku-reserved-dev-id header."

so who knows :)

On Sun, Aug 9, 2015 at 10:07 AM, maihde notifications@github.com wrote:

That is good news! That means that you if you make one more change things will probably start working.

Around line 575 you will find this:

m.audioPlayer = CreateObject("roAudioPlayer")

Then add:

m.audioPlayer.SetCertificatesFile ("common:/certs/ca-bundle.crt") m.audioPlayer.AddHeader("X-Roku-Reserved-Dev-Id", "") m.audioPlayer.InitClientCertificates()

The roAudioPlayer object does not include an EnableHostVerification() or EnablePeerVerfication() methods.

Give that a try and let me know how it works.

On Fri, Aug 7, 2015 at 5:58 PM, bradbulger notifications@github.com wrote:

adding these lines gets it past the connection test

xfer.SetCertificatesFile ("common:/certs/ca-bundle.crt") xfer.AddHeader("X-Roku-Reserved-Dev-Id", "") xfer.InitClientCertificates() xfer.EnableHostVerification(false) xfer.EnablePeerVerification(false)

it can get information about music files etc but not play them - no errors, it just starts a file and then stops like it's finished. ah well.

— Reply to this email directly or view it on GitHub < https://github.com/maihde/roku_subsonic/issues/23#issuecomment-128765660

.

— Reply to this email directly or view it on GitHub < https://github.com/maihde/roku_subsonic/issues/23#issuecomment-129207686>

.

— Reply to this email directly or view it on GitHub https://github.com/maihde/roku_subsonic/issues/23#issuecomment-129224953 .

strunker commented 8 years ago

I can confirm this issue.

Even when using my local IP and non https info it auto redirects to https once it hits the subsonic server and instantly fails to connect via the roku app.. I don't know of a setting on subsonic to prevent https redirect on the local LAN or this issue would likely go away. As mentioned the browsers allow you to get past the self signed cert errors the app/roku don't seem to allow this.

Commod0re commented 7 years ago

I am having the connection issue using a certificate signed by Let's Encrypt. My address is short enough that it all fits no problem, but trying to use the https port results in a connection error