# HLS over HTTPS problems

**URL:** <https://forum.developer.roku.com/t/hls-over-https-problems/1707>\
**Category:** Archived\
**Tags:** roku-developer-program\
**Created:** [June 2, 2011, 5:12pm UTC](https://forum.developer.roku.com/t/hls-over-https-problems/1707 "2011-06-02T17:12:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcelestino](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@rcelestino](https://forum.developer.roku.com/u/rcelestino)\
**Post date:** [June 2, 2011, 5:12pm UTC](https://forum.developer.roku.com/t/hls-over-https-problems/1707/1 "2011-06-02T17:12:19Z")

</div>

Hi,

We are trying to change our HLS demos in ROKU to a real-scenario where we use HTTPS to get Playlist (Variant/And/Quality) and Keys.

But we get the next error message when we use https:// in Playlists and Key or Any combination of this, but over HTTP it works correctly.  
“Known event: 9index:-5 msg: The format is not supported or the media is corrupt.”

For this scenario we set:  
screen=CreateObject(“roVideoScreen”)  
screen.SetCertificatesFile(“common:/certs/ca-bundle.crt”)  
screen.AddHeader(“X-Roku-Reserved-Dev-Id”, “”)  
'screen.InitClientCertificates() 'we comment this line in the last test but this doesnt work too

The certificate of our server was purchased to Thawte, and the certification chain is:  
thawte PRimary Root CA \ Thawte SSL CA \ Our Domain

Also we tried the same m3u8/ts/key files over HTTP and it is working correctly.  
Also We tried to get the files with #curl over https and also it is working correctly.  
Also we tried to set in the metadata Array the m.StreamStickyHttpRedirects=[false,false] 'we use two entries metadata SD, HD. But it didnt work.  
Also we tried to use roUrlTransfer to get the same urls then we print in the telnet console the response and this it is working correctly in each urls (https in playlist, https in quality, https in Key). The example code for this purpose is:

http = CreateObject(“roUrlTransfer”)  
http.SetPort(CreateObject(“roMessagePort”))  
http.SetUrl(“[https://domain/urls](https://domain/urls)”)  
http.SetCertificatesFile(“common:/certs/ca-bundle.crt”)  
http.AddHeader(“X-Roku-Reserved-Dev-Id”, “”)  
http.InitClientCertificates()  
response = http.GetToString()  
print “_**"  
print “Debug response:”,response  
print "**_”

Any idea? Or Any example that is working with HLS in HTTPs? Or Any Help?

Thanks a Lot!

Roberto.  
PS:  
The certificate was purchased with the next properties:  
Cipher : RC4-MD5  
Server public key is 2048 bit

---

<div class="post-metadata">

**Author:** ![rcelestino](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@rcelestino](https://forum.developer.roku.com/u/rcelestino)\
**Post date:** [June 2, 2011, 6:04pm UTC](https://forum.developer.roku.com/t/hls-over-https-problems/1707/2 "2011-06-02T18:04:00Z")

</div>

Also we tried the player with a “un-encrypted wmv” over HTTPS and it didnt work.  
Also we tried the player with a “un-encrypted wmv” over HTTP and it is working correctly.

May be we are doing something bad with screen.SetCertificatesFile(“common:/certs/ca-bundle.crt”)?

Why we can get correctly the response of request over HTTPS using roUrlTransfer?

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![RokuKevin](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@RokuKevin](https://forum.developer.roku.com/u/RokuKevin)\
**Post date:** [June 2, 2011, 6:40pm UTC](https://forum.developer.roku.com/t/hls-over-https-problems/1707/3 "2011-06-02T18:40:10Z")

</div>

Please PM me a link to the stream you are trying to get play, and I’ll help you debug the certs setup.

–Kevin

---

<div class="post-metadata">

**Author:** ![ryaowe](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@ryaowe](https://forum.developer.roku.com/u/ryaowe)\
**Post date:** [September 26, 2011, 11:14pm UTC](https://forum.developer.roku.com/t/hls-over-https-problems/1707/4 "2011-09-26T23:14:27Z")

</div>

I’m having a very similar problem. Were you able to resolve it? I have an HLS stream that works if I set my key URLs to use http, but not if I use https. The error I get is a very generic “An unexpected problem (but not server timeout or HTTP error) has been detected. index: -3 data: 0”

I’m calling SetCertificatesFile(“common:/certs/ca-bundle.crt”) on my roVideoScreen instance.

I am also able to manually download the key over https using roUrlTransfer.

---

<div class="post-metadata">

**Author:** ![ryaowe](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@ryaowe](https://forum.developer.roku.com/u/ryaowe)\
**Post date:** [October 5, 2011, 10:21pm UTC](https://forum.developer.roku.com/t/hls-over-https-problems/1707/5 "2011-10-05T22:21:22Z")

</div>

screen.SetCertificatesDepth(3) seems to have done the trick for me.

---

<div class="post-metadata">

**Author:** ![bmckim](https://avatars.discourse-cdn.com/v4/letter/b/9de0a6/32.png) [@bmckim](https://forum.developer.roku.com/u/bmckim)\
**Post date:** [July 20, 2012, 8:00pm UTC](https://forum.developer.roku.com/t/hls-over-https-problems/1707/6 "2012-07-20T20:00:23Z")

</div>

I have tried setting the certificate depth, but can not get HLS to play over HTTPS. When making regular HTTPS requests in a separate app I am able to use  
video.SetCertificatesFile(“common:/certs/ca-bundle.crt”) and it works fine. I have also tried my own .pem with both certificates included.

```auto
video.SetCertificatesFile("common:/certs/ca-bundle.crt")
'video.SetCertificatesFile("pkg:/source/telvueCA.pem")
video.SetCertificatesDepth(3)
video.InitClientCertificates()
video.SetContent(videoclip)
video.show()

```

```auto
------ Running ------
srt = 
SYS LOG: Status: untrustedcert
LogType: http.error
TargetIp: 38.98.246.175
HttpCode: -1

```
