Forum Discussion

georgemandres's avatar
15 years ago

SSL Certificates

I am trying to use a "roUrlTransfer" object for a url similar to https://blahblahblah.com:8443/blahblbah

I have tried to follow the component documentation and have done the following

Http.SetCertificatesFile("pkg:/certs/cert.pem")
Http.AddHeader("X-Roku-Reserved-Dev-Id", "")
Http.InitClientCertificates()
Http.gettostring()

where the cert.pem is the cert that came with the dev kit.

The Http.gettostring() returns nothing.

Is there something I am missing here?

Thanks,

George

1 Reply

  • I would check the installation of your server-side certificate first. You can do this with curl from a command line on your workstation:

    curl --cacert cert.pem https://yourhost.domain.com/yourURL.htm

    cert.pem is the same file you included in your .pkg at /certs/cert.pem, but copied to the current directory on your workstation. cert.pem must include the CA cert of your web server.

    Note that firmware v2.6 and later includes a CA cert bundle in the common: device that includes common Certificate Authorities trusted by FireFox. If you got your server cert from one of these authorities, you can use "common:/certs/ca-bundle.crt" instead of "pkg:/certs/cert.pem".

    The Http.AddHeader("X-Roku-Reserved-Dev-Id", "") and Http.InitClientCertificates() have been covered in previous forum post. I'll refer you to that post if you desire implementing this content protection scheme: http://forums.roku.com/viewtopic.php?f=34&t=27562&p=171752&hilit=SSL#p171752

    I'm sure you did it already, but your code also has to specify the URL:


    http = CreateObject("roUrlTransfer")
    http.SetPort(CreateObject("roMessagePort"))
    http.SetUrl(url)
    http.SetCertificatesFile("pkg:/certs/cert.pem")
    response = http.GetToString()