balbant
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2017
07:34 AM
How to handle a request with HTTPS protocol in Roku SG while website insecure?
I am working for Roku Scene Graph application, get request data from remote servers specified by URLs but response was not getting and getting error is "SSL: no alternative certificate subject name matches target host name...". How to request with HTTPS URL while website insecure?
my code for request data is below:-
code for download images:-
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)
4 REPLIES 4
tim_beynart
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2017
07:45 AM
Re: How to handle a request with HTTPS protocol in Roku SG while website insecure?
try adding this:
request.enablehostverification(false)
request.enablepeerverification(false)
balbant
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2017
08:59 AM
Re: How to handle a request with HTTPS protocol in Roku SG while website insecure?
Thank you 🙂 @tim_beynart,
Added your code then request data (roUrlTransfer) method working fine, but still download images method is not working. please suggest.
https://forums.roku.com/memberlist.php?mode=viewprofile&u=126532
Added your code then request data (roUrlTransfer) method working fine, but still download images method is not working. please suggest.
https://forums.roku.com/memberlist.php?mode=viewprofile&u=126532
tim_beynart
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2017
09:30 AM
Re: How to handle a request with HTTPS protocol in Roku SG while website insecure?
I have never used roTextureRequest, so I can't help you there, sorry! Good luck
destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2017
10:48 AM
Re: How to handle a request with HTTPS protocol in Roku SG while website insecure?
Would it make more sense to change the requests to http, or to install a self-signed certificate to use HTTPS? As it's a 192 address it ought to be ok to do either on your development network.