I am working on a Roku Scene Graph application. It gets request data from remote servers specified by URLs. However, the response was not returning and showing an error:
SSL: no alternative certificate subject name matches target host name...
How do I make a request with an HTTPS URL while the website is insecure?
My code for request data is below:
request = CreateObject("roUrlTransfer")
request.SetCertificatesFile("common:/certs/ca-bundle.crt")
request.AddHeader("X-Roku-Reserved-Dev-Id", "")
request.InitClientCertificates()
request.SetUrl(url)
port = CreateObject("roMessagePort")
request.SetMessagePort(port)
request.SetPort(port)
timer = createobject("roTimeSpan")
request.AsyncGetToString()
while true
msg = wait(10, port)
if type(msg) = "roUrlEvent" then
if msg.GetResponseCode() = 200 then
m.data = msg.GetString()
return m.data
exit while
else
print msg.GetResponseCode()
print msg.GetFailureReason()
exit while
end if
end if
end while
Code for download images:-
mgr = CreateObject("roTextureManager")
msgport = CreateObject("roMessagePort")
mgr.SetMessagePort(msgport)
request = CreateObject("roTextureRequest","https://192.168.1.10/ball.png")
request.SetCertificatesFile("common:/certs/ca-bundle.crt")
request.InitClientCertificates()
mgr.RequestTexture(request)