Problem connecting to HTTPS

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 ?

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

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

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: https://www.youtube.com/watch?v=2h4zMMN_IGE

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

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

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: https://www.youtube.com/watch?v=2h4zMMN_IGE