malort
11 years agoVisitor
roTextureManager and HTTPS (lag)
Per the docs (http://sdkdocs.roku.com/pages/viewpage. ... Id=3114344) it states to create an HTTPS roTextureRequest, you must set the certificate, however the roTextureManager seems to function properly without it. When you set the cert, it causes quite a bit of lag.
Below is a sample how to test performance. It doesn't actually make the request, but I have verified the requests do work with or without "request.SetCertificatesFile".
The output (from a Roku 3)
Other than the possibility of fixing this lag in the firmware, is it valid to NOT set the certificate? Will the ifHttpAgent interface handle HTTPS without it? If so, it seems like a valid workaround for now.
Below is a sample how to test performance. It doesn't actually make the request, but I have verified the requests do work with or without "request.SetCertificatesFile".
sub main()
m.tm = CreateObject("roTextureManager")
m.RunTest = tmRunTest
print "Create roTextureRequests without a certificate"
m.RunTest(false, 20)
print "Create roTextureRequests with certificate"
m.RunTest(true, 20)
end sub
sub tmRunTest(setCertificate=false as boolean, total=20 as integer)
url = "https://image.roku.com/blog/wp-content/uploads/2014/03/Roku-watch_standalone_BLOG_resize.png"
timer = CreateObject("roTimespan")
for num = 1 to total
request = CreateObject("roTextureRequest", url)
if setCertificate then
request.SetCertificatesFile("common:/certs/ca-bundle.crt")
request.InitClientCertificates()
end if
' we don't actually have to create the request to experience the lag
' m.tm.RequestTexture(request)
end for
ms = timer.TotalMilliseconds()
print " setCertificate: "; setCertificate
print " total requests: "; total
print " requests took: "; ms; "ms"
print " "
end sub
The output (from a Roku 3)
------ Running ------
Create roTextureRequests without a certificate
setCertificate: false
total requests: 20
requests took: 1ms
Create roTextureRequests with certificate
setCertificate: true
total requests: 20
requests took: 1565ms
Other than the possibility of fixing this lag in the firmware, is it valid to NOT set the certificate? Will the ifHttpAgent interface handle HTTPS without it? If so, it seems like a valid workaround for now.