Forum Discussion

RyanMarquiste's avatar
15 years ago

error setting certificate verify locations

I'm using the urlUtils.brs file to retrieve files.

Currently I'm attempting to retrieve a private Google Calendar feed (I've already tested with the public feed, which retrieves fine). When I attempt the retrieve, the following error occurs:

error setting certificate verify locations:
CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none

In my brief research online, it looks like this may be related to either the user not having permissions to that file or the file not existing.

I'm currently on the latest 3.0 build.

Looking for any help or guidance. Thanks in advance.
  • Our cert bundle includes the CA certs that FireFox trusts. If you call SetCertificatesFile() and pass the bundle it will usually enable SSL communication...



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



    --Kevin
  • I've tried this.

    It still fails with the same error:

    *** 1***-77***error setting certificate verify locations:
    CAfile: /etc/pki/tls/certs/ca-bundle.crt
    CApath: none
  • If you want to PM the url you are trying to access, I will help you do so.

    --Kevin
  • Thanks, I was pondering over the code today, and it occurs to me that I may have been using the NewHttp2 method instead of the NewHttp connection. I'll give the NewHttp connection a try once I'm back around my development box to see if that fixes the problem.

    Ryan
  • It looks like the difference in the NewHttp call made all the difference. Thanks for the offer to look into it!

    Ryan
  • Hi Guys

    I am having the same problem

    -77
    error setting certificate verify locations:
    CAfile: /tmp/plugin/BEAAAA8IJGIU/pkg:/certs/cacert.crt
    CApath: none


    Our cert bundle includes the CA certs that FireFox trusts. If you call SetCertificatesFile() and pass the bundle it will usually enable SSL communication...

    Where would I get the CA certs file from. I have a cacert.pem file from the ROKU SDK and used openssl to convert it to cacert.crt and used this in the code as well. But still getting the error.

    It looks like the difference in the NewHttp call made all the difference. Thanks for the offer to look into it!

    Can you clarify what is the NewHttp call that made difference for you?

    Below is my code, which I have been currently testing by placing it in the Main function. I am trying to get the list of items from the server using the provided server API with its username and password. Any help would be much appreciated.


    http = CreateObject("roUrlTransfer")
    port = CreateObject("roMessagePort")
    http.SetUrl("https://someserver/playlist")
    http.SetMessagePort(port)
    ba = CreateObject("roByteArray")
    ba.FromAsciiString("username:password")
    http.AddHeader("Authorization", "Basic " + ba.ToBase64String())
    http.AddHeader("Content-Type", "application/json")
    'http.AddHeader("X-Roku-Reserved-Dev-Id", "")
    http.SetCertificatesFile("pkg:/certs/cacert.crt")
    http.InitClientCertificates()
    http.RetainBodyOnError(true)

    num_tries = 1
    while num_tries > 0
    if (http.AsyncGetToString()) 'AsyncPostFromString("")
    event = wait(0, http.GetPort())
    if type(event) = "roUrlEvent"
    dd = event.GetString()
    code = event.GetResponseCode()
    st = event.GetFailureReason()
    print code; "--------"
    print st; "&&&&&&&&&&&"
    num_tries = num_tries -1
    end if
    end if
    end while