How to handle the SSL error when trying Login through IOS Mobile SDK,Please do respond ASAPThank you

When i am trying this it throughs the HTTP load error -999

 XPMobileSDK.connectAndLoginForServerInfo(serverInfo, username: user!, password: pwd!, shouldSave: **false**, successHandler: { (response) **in**

  **self**.loadCameras()

}, failureHandler: { (error) **in**

})

Hello,

Are you connecting over HTTP or HTTPS?

If over HTTP, have you added NSAppTransportSecurity to your .plist file? Including NSAllsowArbitratyLoads set to YES?

If over HTTPS, is the mobile server using a valid certificate, or a self-signed one?

I am using https

i am added the NSAllsowArbitratyLoads to Yes

and Self-signed i am using

If it’s a self-signed certificate, iOS cannot validate it and that’s why you’re receiving this error.

You may override this by calling setAuthenticationComplete before connecting:

   XPMobileSDK.setAuthenticationComplete(true);

Still, it’s recommended that you validate the certificate yourself, or at least warn the user that the certificate can’t be validated.

You can do this by implementing receiveChallengeForTrustWithInfo callback:

func receiveChallengeForTrustWithInfo(_ info: [String : AnyObject] ){

// TODO: validate the certificate and/or warn the user

}

Note that receiveChallengeForTrustWithInfo is deprecated, as the support for self-signed certificates will be removed in the future