Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Problem connecting to HTTPS
Started by bbk Oct 11 2018 02:42 PM

3 replies to this topic
https nsapptransportsecurity nsexceptiondomains
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

bbk

[GLOBAL: userInfoPane.html]
bbk
  • Enthusiast

  • 39 posts
  • Corona SDK

I have been using the following settings in build.settings

 

   NSAppTransportSecurity =

                            {
                             NSExceptionDomains =
                                {
                                ["gsk-solutions.de"] =
                                    {
                                   
                                        NSIncludesSubdomains = true,
                                        NSThirdPartyExceptionAllowsInsecureHTTPLoads = true,
                                        NSExceptionAllowsInsecureHTTPLoads = true,
                                        
                                    },
 
This has worked fine when I was connecting to http://www.thedomain.de by the following command
 
 _G.theNetworkRequest =  network.request( requestString, "GET", serverCommunicate.networkListener, params );
 
requestString is the URL + the command.
 
When I changed the URL to "https://www.thedomain.de...." the command did not work.
 
What changes do I have to make to the build.settings to make it work ?


[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,714 posts
  • Corona Staff

Can you provide more information?  NSAppTransportationSecurity is an iOS/tvOS only feature if you have to make network requests of http: based URLs. On iOS and tvOS, if you connect to https:, NSAppTransportationSecurity isn't involved at all.

 

If you're building for Android, Windows and other non-Apple platforms, that doesn't even come into play. More importantly, it doesn't impact the simulator at all. You should only run into errors on an actual iOS device or the Xcode simulator.

 

You didn't provide us with a lot of information.

 

Are you building and testing on a device?

Are you getting any errors?

Are you printing the event table in your network listener function?

If so, what is it printing?

What is the actual value of "requestString"?

 

Rob



[TOPIC: post.html]
#3

bbk

[GLOBAL: userInfoPane.html]
bbk
  • Enthusiast

  • 39 posts
  • Corona SDK

Sorry about the lack of information.

 

  • The code is working on the simulator, but not when I install it on the iPad (I just updated to IOS 12.0.1, but it did not work on the previous version either )
     
  • I do not get any errors, because I cannot get the syslog to be shown in the console window of my IDE (Zerobrane version 1.8) (It did work earlier - several months ago, but for some reason it stopped working when I run the app on the connected iPad..... any help would be appreciated)
     
  • I have put a native.showalert message just before and after the network.request command, and they are shown, but the native.showalert message that I have put at the start of the network listener function is not shown. This also means that the event table is not received. (I also have function on the server that tracks the requests, and this is never triggered)
     
  • The actual requestString is something like "https://www.thedomain.de/index.php?command=XXX", if I change it to  "http://www.thedomain.de/index.php?command=XXX" (HTTP instead of HTTPS), then it works on the  iPad (both work on the Simulator)

 

Bjørn



[TOPIC: post.html]
#4

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,093 posts
  • Corona SDK

Tip: You can plug your device into your Mac and see the log in the xCode device debug console.

 

This old video of mine (answering another thread a while back) shows how to open the console: 


Edited by roaminggamer, 11 October 2018 - 05:35 PM.

  • bbk likes this


[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: https, nsapptransportsecurity, nsexceptiondomains