"TheEndless" wrote:
I just confirmed the same lag here with the call to SetCertificatesFile on roTextureRequest. It takes over twice as long on the Roku TV.
"malort" wrote:
is it valid to NOT set the certificate? Will the ifHttpAgent interface handle HTTPS without it?
In every other component, the answer to that question is no (no clue why Roku chose to make it a requirement instead of defaulting to the common certs). It's possible they added default certificates to the roTextureRequest, but I don't know if I'd trust that. If it works for you, then I suppose you could take the risk. Otherwise, you could potentially use roUrlTransfer to asynchronously download the image to tmp:, then load the tmp: path with an roTextureRequest. roUrlTransfer definitely requires the SetCertificatesFile(), but it doesn't experience anywhere near the lag that roTextureRequest exhibits.
It looks like you can get way with not setting the cert in roUrlTransfer, if you set EnablePeerVerification false. Of course, that isn't optimal, and it's probably moot because roUrlTransfer, as you said, doesn't experience the lag. I am wondering though, by not setting the cert in roTextureRequest, is defaulting to EnablePeerVerification=false or is it actually secure using the default certs?
> obj = CreateObject("roUrlTransfer")
> obj.SetUrl("https://roku.com")
> ?len(obj.gettostring())
0
> obj.EnablePeerVerification(false)
> ?len(obj.gettostring())
39177
"TheEndless" wrote:
Roku*, I'd love to know why the SetCertificatesFile() call on roTextureRequest takes over 100ms. The fact that that call blocks execution for that long seriously undermines one of the primary uses for roTextureManager (asynchronous image loading).
Just some more tests, to confirm the lag and show that roUrlTransfer isn't affected.
roTextureRequest with and without "SetCertificatesFile"
> for i = 0 to 5 : timer = CreateObject("roTimeSpan"): request = CreateObject("roTextureRequest", "https://roku.com"): ?timer.TotalMilliseconds() : end for
0
1
0
0
0
0
> for i = 0 to 5 : timer = CreateObject("roTimeSpan"): request = CreateObject("roTextureRequest", "https://roku.com"): request.SetCertificatesFile("common:/certs/ca-bundle.crt") : ?timer.TotalMilliseconds() : end for
76
73
72
73
73
73
roUrlTransfer with and without "SetCertificatesFile"
> for i = 0 to 5: timer = CreateObject("roTimeSpan"): obj = CreateObject("roUrlTransfer") : ?timer.TotalMilliseconds() : end for
1
0
1
0
1
0
> for i = 0 to 5 : timer = CreateObject("roTimeSpan"): obj = CreateObject("roUrlTransfer") : obj.SetCertificatesFile("common:/certs/ca-bundle.crt") : ?timer.TotalMilliseconds() : end for
1
1
1
0
1
0
On a TCL Roku TV, as you stated, it's even worse. I don't even want to break out a Roku 1 or LT.
for i = 0 to 5 : timer = CreateObject("roTimeSpan"): request = CreateObject("roTextureRequest", "https://roku.com"): request.SetCertificatesFile("common:/certs/ca-bundle.crt") : ?timer.TotalMilliseconds() : end for
110
130
132
133
132
130