Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Fetch XML via HTTPS

I want to use HTTPS to fetch my XML files, but simply putting https in the URL isn't enough. After reading the documentation I think maybe I need to use SetCertificatesFile() to give it some key? The key of the CA? Do I need to bundle the cert with my app, or can I pass it a URL to get the cert?

url = "https://www.perturb.org/hls/test.xml"
http = NewHttp(url)
http.SetCertificatesFile(???)
rsp = http.GetToStringWithRetry()
0 Kudos
3 REPLIES 3
RokuChris
Roku Employee
Roku Employee

Re: Fetch XML via HTTPS

In most cases, you can just use the built in cert bundle.

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


http://sdkdocs.roku.com/display/RokuSDK ... rlTransfer

The URL Transfer object authenticates your web server by calling SetCertificatesFile()with a .pem file that includes the certificate authority cert for the authority (like Verisign, Thawte, etc… or your own with OpenSSL) that signed your web server certificate before making the https request. You can use the Roku standard cert bundle (similar to Mozilla) stored in common:/certs/ca-bundle.crt
0 Kudos

Re: Fetch XML via HTTPS

I'm trying to set it, and I'm getting a function not found?

url = "https://www.perturb.org/hls/test.xml"
http = NewHttp(url)
http.SetCertificatesFile("common:/certs/ca-bundle.crt")
http.InitClientCertificates()


Member function not found in BrightScript Component or interface. (runtime error &hf4) in .../pkg:/source/categoryFeed.brs(65)

065: http.SetCertificatesFile("common:/certs/ca-bundle.crt")
0 Kudos

Re: Fetch XML via HTTPS

Disregard... I didn't realize the roUrlTransfer object was http.Http. Once I set that, it works fine. My HTTPS is working, thanks!
0 Kudos