Developers

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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.
Tags (1)
0 Kudos
6 REPLIES 6
RokuKevin
Visitor

Re: error setting certificate verify locations

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
Tags (1)
0 Kudos

Re: error setting certificate verify locations

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
Tags (1)
0 Kudos
RokuKevin
Visitor

Re: error setting certificate verify locations

If you want to PM the url you are trying to access, I will help you do so.

--Kevin
Tags (1)
0 Kudos

Re: error setting certificate verify locations

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
Tags (1)
0 Kudos

Re: error setting certificate verify locations

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

Ryan
Tags (1)
0 Kudos
ov2015
Visitor

Re: error setting certificate verify locations

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
Tags (1)
0 Kudos
Community is Being Upgraded!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 19th and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

We're sorry for this disruption — we’re excited to share what’s next!