Software Archive
Read-only legacy content
17061 Discussions

My app can able to connect https website in Emulator , but not in mobile device , how could i debug the issue.

Thirukkumaran_N_
Beginner
1,210 Views

My application is connecting to an API through https and it is working fine in Emulator, but when i pushed to Server and tested in my Samsung mobile device ( A8), i am not getting the expected response, looks device couldn't able to connect to https, how could i debug this issue

0 Kudos
26 Replies
Amrita_C_Intel
Employee
1,003 Views

Hello,

Can you try building your app and installing on device? App preview has some limitations so it is better to check by insatlling app on device.

To find more about how to build? please refer this: https://software.intel.com/en-us/xdk/docs/using-the-build-tab

0 Kudos
Amrita_C_Intel
Employee
1,003 Views

Emulator is just a simulator. There are some limitations just check out this link: https://software.intel.com/en-us/xdk/docs/dev-emulator

Try to build with crosswalk and use either build or debug tab to see the actual behavior of the app.

0 Kudos
Anusha_M_Intel1
Employee
1,003 Views

Also make sure you have included the site in your whitelist information in the projects tab under build settings. You can read more about it here: https://software.intel.com/en-us/xdk/docs/using-cordova-whitelist-rules-with-intel-xdk?language=en

0 Kudos
Thirukkumaran_N_
Beginner
1,003 Views

Team

I have build with external whitelist as "https://" since i am calling a https website from the application, but still its failing, could you help to advise

 

Regards

Thiru

 

0 Kudos
PaulF_IntelCorp
Employee
1,003 Views

What happens if you just put * in the whitelist entry? And use the W3C option?

0 Kudos
Thirukkumaran_N_
Beginner
1,003 Views

I have tried using * and also tried https://*,  but both didnt work, can you help to check 

Regards

Thiru

0 Kudos
Hamilton_Tenório_da_
Valued Contributor I
1,003 Views

The CONNECTION plugin is checked?

0 Kudos
Thirukkumaran_N_
Beginner
1,003 Views

could you advise where is it available, don't find in plugin management,

0 Kudos
PaulF_IntelCorp
Employee
1,003 Views

Thirukkumaran -- can you provide a sample app that illustrates what you are trying to do and results in the failure? Create a simple app that results in the failure and ZIP the entire project directory for that app. Then attach the ZIP to your post, using the "attach media" button (scroll down below your edit window).

0 Kudos
Thirukkumaran_N_
Beginner
1,003 Views

Hi Paul, I am working on it, will update you shortly - Thiru

0 Kudos
Paschalis_P_
Beginner
1,003 Views

I got the same problem also. Somehow we need to override the ssl error

0 Kudos
Thirukkumaran_N_
Beginner
1,003 Views

Hi Paul, sorry for the delay, i have created a sample app,  i have not given the actual url and related header details, please check.

Regards

Thiru

 

0 Kudos
PaulF_IntelCorp
Employee
1,003 Views

Hi Thiru, I'm afraid this sample app is not helping me understand the issue. I see that you have configured an AJAX call that references a URL named https://xxx/ -- which fails on the Emulate tab because that is an unresolvable address. You have set the "Network Requests (Internal Whitelist)" to "*" and left the "Intent" whitelist empty. I'm assuming the URL you are using is a valid URL? What happens if you put an "*" in the Intent whitelist, as well?

0 Kudos
Thirukkumaran_N_
Beginner
1,003 Views

HI Paul

sorry that i cant provide the URL, but the URL is valid and it is working fine in emulator,  i tried below options

1) "*" for "Network Requests (Internal Whitelist)"  and  "*" for "Intent whitelist empty", 

2) "*" for "Network Requests (Internal Whitelist)"  and   empty  for "Intent whitelist empty", 

3) "https://*" for  "Network Requests (Internal Whitelist)" and "https://*" for "Intent whitelist empty", 

Note that i have tried these options in "Crosswalk for Andorid" build & "Android" build,  and tested in Samsung A8 model, let me know if i need to enable any options in my mobile,

1 more issue is, when i tried to build fo iOS, i have got the attached certificate error, i have downloaded the certificate from step 1a and tried to upload in step 1b in "iOS certificate", could you check and advise.

 

Regards

Thiru

 

 

 

0 Kudos
PaulF_IntelCorp
Employee
1,003 Views

Thiru, I wonder if this is part of the problem:

Screen Shot 2015-11-23 at 7.01.01 PM.png

0 Kudos
Thirukkumaran_N_
Beginner
1,003 Views

Paul

I have identified the issue, the request header Origin is set to "file://" if i invoke https URL from my mobile and the URL is not allowing this origin value, i simulated this case in SOAP UI and i have got the same error response when i pass origin as "file://" and it works finr for "file://1" in SOAP UI,

could you advise how can i setup the default origin for https calls.

Regards

Thiru

 

 

 

 

 

0 Kudos
Thirukkumaran_N_
Beginner
1,003 Views

the https service which i am calling is a POST service, hence origin header gets added 

0 Kudos
PaulF_IntelCorp
Employee
1,003 Views

Thiru, if you are trying to post a file to your server, you might be better off using the Cordova file-transfer plugin to accomplish that. I suspect it exists for this very reason that you are describing.

0 Kudos
Thirukkumaran_N_
Beginner
1,003 Views

Paul

I am not posting a file, i am sending user id and password in post call to authenicate using an URL, but origin header is going as "file://" from my mobile in ajax call, hence the request has been rejected from server,

could you advise how the origin has been set ?

Regards

Thiru

 

 

0 Kudos
PaulF_IntelCorp
Employee
728 Views

That would be the appropriate origin, since your app is not associated with a domain or web server, it is a standalone app that just happens to use HTML5 as the language. There are some sample apps that have been built by one of my colleagues that cover logging into a site using OAuth techniques.

https://software.intel.com/en-us/xdk/article/oauth2-with-intelxdk-cordova-html5
https://software.intel.com/en-us/xdk/docs/oauth2authentication
https://github.com/krisrak/jquery-cordova-oauth2

 

0 Kudos
Reply