Italian errore connessione al file php

ken87

Active Member
Licensed User
Longtime User
Ciao quando tento di eseguire questa connessione in b4i con macchina emulata:
B4X:
job2.Initialize("job2", Me)
        job2.Download2("http://miosito.com/app/verifica.php", _
    Array As String("emaild",email2))

Ricevo questo errore:
B4X:
ResponseError: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection., status code: 0

Cosa è causato?
Grazie mille
 

ken87

Active Member
Licensed User
Longtime User
ciao
ho provato ad inserire il comando ma continua a dare errore posto il codice:

B4X:
#ATSEnabled: True

B4X:
'Code module
#Region  Project Attributes
    #ApplicationLabel: Programma di prova
    #Version: 1.0.0
    'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
    #iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
    #iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown

    #ATSEnabled: True
  
    #Target: iPhone, iPad
    #ATSEnabled: True
    #MinVersion: 8
  
#End Region

Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
   Page1.Initialize("Page")
   Page1.Title = "Page1"
   Page1.RootPanel.LoadLayout("uno")
   Page1.RootPanel.Color = Colors.White
   Page1.Tag="Page1"
   Page1.RootPanel.Tag="Page1"
   NavControl.ShowPage(Page1)

test_sito

End Sub

Sub test_sito
    Dim hj As HttpJob
    hj.Initialize("", Me)
    hj.Download("http://www.tiscali.it")
    Wait For (hj) JobDone(job As HttpJob)
    If job.Success Then
        Log("si")
    Else
        LogColor ("no",Colors.red)
    End If
End Sub

Sto utilizzando mac os 10.12
emu Vmware 15
xcode 9
Emulatore Iphone 8 Plus

Ovviamente il sito dal emaulatore naviga tranquillamente.
Grazie mille
 

Star-Dust

Expert
Licensed User
Longtime User
Non hai seguito correttamente le istruzioni.
Devi anche aggiungere il dominio da autorizzare
B4X:
#PlistExtra: <key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><false/>
#PlistExtra: <key>NSExceptionDomains</key><dict>
'lista dei domini da escludere da SSL (example.com and b4x.com)
#PlistExtra: <key>tiscali.it</key><dict><key>NSIncludesSubdomains</key><true/><key>NSExceptionAllowsInsecureHTTPLoads</key><true/></dict>
#PlistExtra: <key>b4x.com</key><dict><key>NSIncludesSubdomains</key><true/><key>NSExceptionAllowsInsecureHTTPLoads</key><true/></dict>
'end of excluded domains
#PlistExtra: </dict>
#PlistExtra: </dict>
 
Top