My Roku app uses an roUrlTransfer object to retrieve data from a REST endpoint running on AWS. The endpoint uses a certificate for security.
I can successfully connect to and retrieve data from the same REST endpoint via Postman.
But when I try to connect to the REST endpoint from my Roku app, I get the error message:
get_PurchasedSTAProductsFromAWSEndpoint got error code -60
SSL certificate problem: unable to get issuer certificate
Here is my roUrlTransfer code:
urlTransfer = CreateObject("roUrlTransfer")
port = CreateObject("roMessagePort")
urlTransfer.SetMessagePort(port)
urlTransfer.SetUrl(m.global.api.BaseURL + "myRESTendpoint")
urlTransfer.SetCertificatesFile("pkg:/certificates/ca_bundle.crt") //custom cert & key
urlTransfer.AddHeader("Content-Type", "application/json")
urlTransfer.AddHeader("X-Roku-Reserved-Dev-Id", "my-dev-id")
urlTransfer.InitClientCertificates()
urlTransfer.RetainBodyOnError(true)
urlTransfer.EnableEncodings(true)
AddTrackingHeader(urlTransfer)
requestBody = {}
requestBody["uuid"] = m.global.device_info.uuid
requestBody = FormatJson(requestBody)
if (urlTransfer.AsyncPostFromString(requestBody))
while (true)
[.....]
How can I correct this?