Your Digital Media Has Never Looked So Good

 
User avatar
wpinkman
Topic Author
Posts: 36
Joined: Mon Sep 09, 2013 10:36 am
Location: Silicon Valley
Contact:

roPosterScreen / roSlideshow can't load Instagram images

Wed Mar 25, 2015 8:41 am

My channel, Rokagram, started having trouble yesterday. I think I've debugged it down to the fact that the URL's returned from the Instagram API for images are now all HTTPS, but it's not just that. The CDN they are hosted on seems to cause problems for components like roPosterScreen and roSlideShow even if I call SetCertificatesFile and InitClientCertificates on them. The same image URL in question loads fine in a browser. I even tried an experiment of using roUrlTransfer to download the image into "tmp://" and then using the temp file as the posterUrl and that worked! Here's some sample code that demonstrates the problem.

Running the code shows a poster screen with one item, but the cover image never loads. I have a photo.. but I can't figure out how to attach it to a forum post. Trust me.. it doesn't work.

Sub Main()

   port = CreateObject("roMessagePort")
   screen = CreateObject("roPosterScreen")
      
   screen.SetMessagePort(port)
   screen.SetCertificatesFile("common:/certs/ca-bundle.crt")
   screen.InitClientCertificates()
   screen.SetListStyle("arced-square")
      
   posterUrl = "https://scontent.cdninstagram.com/hphotos-xaf1/t51.2885-15/s150x150/e15/11049316_1583549288528575_1352209504_n.jpg"
   meta = {}
   meta.HdPosterUrl = posterUrl
   meta.SdPosterUrl = posterUrl
   
   contentList = []
   contentList.Push(meta)
   
   screen.SetContentList(contentList)
   screen.Show()
   
   wait(0, port)

End Sub
--andy (channel: Rokagram)
 
belltown
Posts: 1465
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: roPosterScreen / roSlideshow can't load Instagram images

Wed Mar 25, 2015 12:37 pm

It will work if you change the "https" in the image url to "http". Not sure why. The https image url downloads just fine using roUrlTransfer, but not with the BS screen components. Again, not sure why.
https://github.com/belltown/
 
Veeta
Posts: 149
Joined: Tue Aug 12, 2014 4:44 am
Location: http://www.veeta.tv
Contact:

Re: roPosterScreen / roSlideshow can't load Instagram images

Wed Mar 25, 2015 12:51 pm

Are you listening for http events on roSystemLog? If so, you should be getting an error code which will better explain what is happening.
 
belltown
Posts: 1465
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: roPosterScreen / roSlideshow can't load Instagram images

Wed Mar 25, 2015 1:00 pm

Veeta wrote:
Are you listening for http events on roSystemLog? If so, you should be getting an error code which will better explain what is happening.

There is no roSystemLogEvent when using the https url, only when using the http url.
https://github.com/belltown/
 
User avatar
wpinkman
Topic Author
Posts: 36
Joined: Mon Sep 09, 2013 10:36 am
Location: Silicon Valley
Contact:

Re: roPosterScreen / roSlideshow can't load Instagram images

Wed Mar 25, 2015 1:11 pm

Thanks @belltown. Yes.. roUrlTransfer works fine. This is a head scratcher. I might try that https -> http trick, but I'm afraid that won't work forever.
--andy (channel: Rokagram)
 
Veeta
Posts: 149
Joined: Tue Aug 12, 2014 4:44 am
Location: http://www.veeta.tv
Contact:

Re: roPosterScreen / roSlideshow can't load Instagram images

Wed Mar 25, 2015 1:21 pm

I got a timeout during testing.

** SystemLog http.error: Status = connectiontimeout
** SystemLog http.error: LogType = http.error
** SystemLog http.error: TargetIp = 31.13.73.10
** SystemLog http.error: HttpCode = -1
** SystemLog http.error: Datetime = 03/25/2015 20:11:10.836
** SystemLog http.error: OrigUrl = https://scontent.cdninstagram.com/hphot ... 9504_n.jpg
** SystemLog http.error: Url = https://scontent.cdninstagram.com/hphot ... 9504_n.jpg
** SystemLog http.error: Method = GET
 
User avatar
wpinkman
Topic Author
Posts: 36
Joined: Mon Sep 09, 2013 10:36 am
Location: Silicon Valley
Contact:

Re: roPosterScreen / roSlideshow can't load Instagram images

Wed Mar 25, 2015 1:42 pm

Thanks Veeta! I hope someone knows the root cause.
--andy (channel: Rokagram)
 
belltown
Posts: 1465
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: roPosterScreen / roSlideshow can't load Instagram images

Wed Mar 25, 2015 1:45 pm

Veeta wrote:
I got a timeout during testing.

** SystemLog http.error: Status = connectiontimeout
** SystemLog http.error: LogType = http.error
** SystemLog http.error: TargetIp = 31.13.73.10
** SystemLog http.error: HttpCode = -1
** SystemLog http.error: Datetime = 03/25/2015 20:11:10.836
** SystemLog http.error: OrigUrl = https://scontent.cdninstagram.com/hphot ... 9504_n.jpg
** SystemLog http.error: Url = https://scontent.cdninstagram.com/hphot ... 9504_n.jpg
** SystemLog http.error: Method = GET

I'm seeing the same thing. I didn't wait the full 30 seconds when I tried it before.

My first thought was it was something to do with the certificates, although presumably roUrlTransfer and roPosterScreen both handle them the same way through the ifHttpAgent interface.
https://github.com/belltown/
 
Veeta
Posts: 149
Joined: Tue Aug 12, 2014 4:44 am
Location: http://www.veeta.tv
Contact:

Re: roPosterScreen / roSlideshow can't load Instagram images

Wed Mar 25, 2015 2:09 pm

I just traced the network and there are differences in the SSL handshaking from roUrlTransfer to roPosterScreen. Just speculating, it appears that the SSL handshaking doesn't work in roPosterScreen and the server side just stops responding.
 
User avatar
wpinkman
Topic Author
Posts: 36
Joined: Mon Sep 09, 2013 10:36 am
Location: Silicon Valley
Contact:

Re: roPosterScreen / roSlideshow can't load Instagram images

Wed Mar 25, 2015 4:00 pm

roSlideShow also has the issue FWIW
--andy (channel: Rokagram)
 
User avatar
wpinkman
Topic Author
Posts: 36
Joined: Mon Sep 09, 2013 10:36 am
Location: Silicon Valley
Contact:

Re: roPosterScreen / roSlideshow can't load Instagram images

Wed Mar 25, 2015 4:02 pm

ifHttpAgent seams to have a (new?) call: SetCertificatesDepth(depth as Integer)

Not sure what it does or what a good value would be.
--andy (channel: Rokagram)
 
User avatar
wpinkman
Topic Author
Posts: 36
Joined: Mon Sep 09, 2013 10:36 am
Location: Silicon Valley
Contact:

Re: roPosterScreen / roSlideshow can't load Instagram images

Wed Mar 25, 2015 4:05 pm

Thanks Veeta. Adding the the puzzle is the fact that roPosterScreen does work for some HTTPS images. In my case some of the Instagram photos are hosted on a Akami CDN and those work fine (generally the user profile pics). It looks like the main photo content moved to a different CDN technology and they are the ones having the problem. Maybe a more complicated SSL handshake on one CDN vs. the other?
--andy (channel: Rokagram)
 
belltown
Posts: 1465
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: roPosterScreen / roSlideshow can't load Instagram images

Wed Mar 25, 2015 9:48 pm

It looks like an HTTPS request using roPosterScreen, roSlideshow, etc. is only negotiated by the Roku to use TLS 1.0, whereas an HTTP request using roUrlTransfer negotiates the use of TLS 1.2. Due to security vulnerabilities discovered in older TLS versions, it's possible that some servers are refusing to allow connections that use the older versions, which might explain why one CDN (Akamai) works and the other one (Instagram) does not.

It would be helpful if someone from Roku could look into this and verify whether roPosterScreen, etc. erroneously only supports TLS 1.0.
https://github.com/belltown/
 
User avatar
wpinkman
Topic Author
Posts: 36
Joined: Mon Sep 09, 2013 10:36 am
Location: Silicon Valley
Contact:

Re: roPosterScreen / roSlideshow can't load Instagram images

Thu Mar 26, 2015 9:27 am

Yes.. thanks. I patched up my channel with a hack to convert the URL's from HTTPS to HTTP, but who knows how long that will work.

Add roImageCanvas to the list of components that has the same bug.
--andy (channel: Rokagram)
 
crawfishmedia
Posts: 38
Joined: Tue Dec 18, 2012 12:39 am
Location: Calgary, AB

Re: roPosterScreen / roSlideshow can't load Instagram images

Sun May 10, 2015 10:46 pm

Hi guys, I am also linking to my Instagram photos and recently found they wouldn't display in the slideshow anymore.
Great to see others are working through this issue. This is a nasty bug, crippling even.
Thanks for your valuable inputs :)
AC

Who is online

Users browsing this forum: No registered users and 3 guests