this.player.SetCertificatesFile("our_cert_file")
this.player.InitClientCertificates()
url = "https://roku.com"
port = CreateObject("roMessagePort")
'' Invalid CA bundle
cert = "pkg:/certs/invalid-bundle.crt"
obj = CreateObject("roUrlTransfer")bj.SetPort(port)
bj.SetUrl(url)
bj.SetCertificatesFile(cert)
bj.AsyncGetToString()
bj.InitClientCertificates():event = wait(0, port)
?"code=";event.GetResponseCode();" reason=";event.GetFailureReason()
code=-77 reason=error setting certificate verify locations:
CAfile: /tmp/plugin/PIAAAAKH5uUG/pkg:/certs/invalid-bundle.crt
CApath: none
'' Valid ca bundle, but wrong (not for the current url)
cert = "pkg:/certs/wrong-bundle.crt"
obj = CreateObject("roUrlTransfer")bj.SetPort(port)
bj.SetUrl(url)
bj.SetCertificatesFile(cert)
bj.AsyncGetToString()
bj.InitClientCertificates():event = wait(0, port)
?"code=";event.GetResponseCode();" reason=";event.GetFailureReason()
code=-60 reason=SSL certificate problem: unable to get local issuer certificate
'' yeah... no ca file specified
cert = ""
obj = CreateObject("roUrlTransfer")bj.SetPort(port)
bj.SetUrl(url)
bj.SetCertificatesFile(cert)
bj.AsyncGetToString()
bj.InitClientCertificates():event = wait(0, port)
?"code=";event.GetResponseCode();" reason=";event.GetFailureReason()
code=-77 reason=error setting certificate verify locations:
CAfile:
CApath: none
'' Default cert supplied - working
cert = "common:/certs/ca-bundle.crt"
obj = CreateObject("roUrlTransfer")bj.SetPort(port)
bj.SetUrl(url)
bj.SetCertificatesFile(cert)
bj.AsyncGetToString()
bj.InitClientCertificates():event = wait(0, port)
?"code=";event.GetResponseCode();" reason=";event.GetFailureReason()
code= 200 reason=OK
If the two lines above are removed from the player, or if a dummy file is added to theSetCertificatesFile call then video playback works.