Check connection error with tsNet in Sonoma/LC10dp7

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
trevix
Posts: 962
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Check connection error with tsNet in Sonoma/LC10dp7

Post by trevix » Fri Jan 19, 2024 10:02 pm

Hello.
In Monterey and LC 10 Dp6 I used to check if my standalone has an internet connection, using the following script:

Code: Select all

--check internet connection
--FIND  pubblic IP ot return false
function CheckConnection pAlwaysCheck
     local tAnswer,tArray,tHeaders, tRecvHeaders, tResult, tBytes
     if not pAlwaysCheck then
          if sMyIP is empty then
               return false
          else
               return true
          end if
     end if
     put empty into sMyIP
     libUrlSetSSLVerification true --needed because to communicate with FMS it has to be false
     put tsNetGetTimeouts() into tOldTimeouts --save old timeout
     tsNetSetTimeouts 5, 7000, 7000, 7000, 30, 1000 --max 7 seconds wait, if no connection
     --tsNetSetTimeouts 5,7000, 7000, 7000, 0, 0 --max 7 seconds wait, if no connection
     put "https://api.ipify.org?format=json" into tGetString
     put true into pSettings["no_reuse"] --this clear the cache??
     put tsNetGetSync(tGetString, tHeaders, tRecvHeaders, tResult, tBytes, pSettings) into tArray
     tsNetSetTimeouts item 1 of tOldTimeouts, item 2 of tOldTimeouts, item 3 of tOldTimeouts, item 4 of tOldTimeouts, item 5 of tOldTimeouts, item 6 of tOldTimeouts
     libUrlSetSSLVerification false --needed because to communicate with FMS it has to be false
     
     if tArray is not empty then
          put JSONToArray(tArray) into tArray --mergJson extension must be enabled on mobile
          put tArray["IP"] into sMyIP --local
          put 0 into gPrefTF["NoConn"] --reset false connection to internet
          --MyLog "","CheckConnection OK" && sMyIP
          return true
     else
          --breakpoint
          MyLog "","CheckConnection error" && tResult 
          return false
     end if
end CheckConnection
I recently updated my Mac to Sonoma, LC 10 DP7 and Xcode 15.
Now, my script on Android returns the following errore:
tsneterr: (77) error setting certificate verify locations: CAfile: /data/user/0/com.trevix.it.segnapunto/files/ca-bundle.crt CApath: none
I am not sure if this depends on Sonoma, LC 10 DP7 or "another" google policy update.
Any clue?
Thanks
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

Post Reply

Return to “Android Deployment”