scottchiefbaker
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2013
11:40 AM
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()
3 REPLIES 3


Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2013
11:49 AM
Re: Fetch XML via HTTPS
In most cases, you can just use the built in cert bundle.
http://sdkdocs.roku.com/display/RokuSDK ... rlTransfer
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
scottchiefbaker
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2013
12:26 PM
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")
scottchiefbaker
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2013
12:40 PM
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!