Problems with HTTPS and Android

Hi,

I have problems with “network.request” when the url is starting with https - but only with Android.

I’m trying to do this:

network.request("https://workplandev.grothe-gruppe.de:4444/tools/mobile/read.aspx?f=1&action=ping", "GET", function(evt) if evt.isError then native.showAlert("Error!", "There was an error...") else native.showAlert("Success!", "Everything is alright...") end end)

Everything is fine in the simulator, my browser and on my iOS device (iPhone 5). But when I try to do this on my Android device (Nexus 7) I always get the “error” message.

On the other hand… when I’m trying to do this:

network.request("https://encrypted.google.com", "GET", function(evt) if evt.isError then native.showAlert("Error!", "There was an error...") else native.showAlert("Success!", "Everything is alright...") end end)

Even the Android device shows the “success” message. So it seems that there is a problem with the first url. But what is wrong with it?! The only platform that gives me an error with that url is the android device.

Maybe someone can help me to be clearer what could cause the problem (with ONLY that https-url and ONLY on Android devices)…

Thank you very much in advance!!!

Greetings,

Kai

Can you zip that code up and file a bug report please?  use the “Report a bug” link at the very top of the page.

Thanks

Hi Rob,

thanks for your reply. I just reported a bug. If everyone else wants to reproduce this, this is my sample code:

----------------------------------------------------------------------------------------- -- -- main.lua -- ----------------------------------------------------------------------------------------- local widget = require("widget") -- Your code here local lblStatus = display.newText("", display.contentWidth / 2, 220, native.systemFont, 16) lblStatus.text = "Please tap a button" local btnTest1 = widget.newButton{ left = 20, top = 100, width = display.contentWidth - 40, height = 40, label = "google url", onEvent = function(evt) if evt.phase == "ended" then tryRequest("https://encrypted.google.com") end end } local btnTest2 = widget.newButton{ left = 20, top = 150, width = display.contentWidth - 40, height = 40, label = "test url", onEvent = function(evt) if evt.phase == "ended" then tryRequest("https://xxx.grothe-gruppe.de:4444/tools/mobile/read.aspx?f=1&action=ping") end end } function tryRequest(url) network.request(url, "GET", function(evt) if evt.isError then lblStatus.text = "Error..." else lblStatus.text = "Success!" end end) lblStatus.text = "Please wait..." end

Greetings,

Kai

Can you zip that code up and file a bug report please?  use the “Report a bug” link at the very top of the page.

Thanks

Hi Rob,

thanks for your reply. I just reported a bug. If everyone else wants to reproduce this, this is my sample code:

----------------------------------------------------------------------------------------- -- -- main.lua -- ----------------------------------------------------------------------------------------- local widget = require("widget") -- Your code here local lblStatus = display.newText("", display.contentWidth / 2, 220, native.systemFont, 16) lblStatus.text = "Please tap a button" local btnTest1 = widget.newButton{ left = 20, top = 100, width = display.contentWidth - 40, height = 40, label = "google url", onEvent = function(evt) if evt.phase == "ended" then tryRequest("https://encrypted.google.com") end end } local btnTest2 = widget.newButton{ left = 20, top = 150, width = display.contentWidth - 40, height = 40, label = "test url", onEvent = function(evt) if evt.phase == "ended" then tryRequest("https://xxx.grothe-gruppe.de:4444/tools/mobile/read.aspx?f=1&action=ping") end end } function tryRequest(url) network.request(url, "GET", function(evt) if evt.isError then lblStatus.text = "Error..." else lblStatus.text = "Success!" end end) lblStatus.text = "Please wait..." end

Greetings,

Kai