1

I am Using IBM Worklight Version 6.2.I made a hybrid application. I am able to make and deploy .apk file and is running fine. But when I Added Environment for iPhone. I imported that folder in X Code and run that project File. Application is running fine but I am not able to get the response from the Adapter. Below is the exception I am getting.

The Error is of 403 saying: establishSSLClientAuth isCertificateExists:  false

My X-code version is 6.1

Kindly help me resolving this please

2016-05-17 12:40:42.277 mServe[683:138427] [DEBUG] [NONE] establishSSLClientAuth
2016-05-17 12:40:42.284 mServe[683:138394] [WARN] [USER_CERT_AUTH] +[WLUserAuthManager getCertificateIdentifier] in WLUserAuthManager.m:68 :: Certificate Identifier Key: com.worklight.userenrollment.certificate:com.mServe
2016-05-17 12:40:42.301 mServe[683:138394] THREAD WARNING: ['UserAuth'] took '17.668701' ms. Plugin should use a background thread.
2016-05-17 12:40:42.305 mServe[683:138477] [DEBUG] [NONE] Request [http://10.1.54.101:10080/Android/apps/services/api/mServe/iphone/query]
2016-05-17 12:40:42.310 mServe[683:138427] [DEBUG] [NONE] establishSSLClientAuth isCertificateExists:  false
2016-05-17 12:40:42.488 mServe[683:138394] [ERROR] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFailed:error:] in WLAFHTTPClientWrapper.m:216 :: Request Failed
2016-05-17 12:40:42.494 mServe[683:138394] [ERROR] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFailed:error:] in WLAFHTTPClientWrapper.m:217 :: Response Status Code : 403
2016-05-17 12:40:42.500 mServe[683:138394] [ERROR] [WL_AFHTTPCLIENTWRAPPER_PACKAGE] -[WLAFHTTPClientWrapper requestFailed:error:] in WLAFHTTPClientWrapper.m:218 :: Response Error : Expected status code in (200-299), got 403
PravinS
  • 2,640
  • 3
  • 21
  • 25
Dss
  • 33
  • 7

1 Answers1

0

You are likely using iOS 9. iOS 9 by default uses a new security measure called ATS (Application Transport Security). During development you can disable it in order for network requests to pass successfully.

Please see here: https://mobilefirstplatform.ibmcloud.com/blog/2015/09/09/ats-and-bitcode-in-ios9/

Essentially you need to edit, in Xcode, the application's .plist file by adding the following:

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSExceptionDomains</key>
  <dict>
    <key>localhost</key>
    <dict>
      <!--Include to allow HTTP requests-->
      <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
      <true/>
    </dict>
  </dict>
</dict>
Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • 1
    Hi Idan,thanks for your reply but I am not using iOS 9, i am using iOS 7. I really dont know why i am getting this error.I tried this also in iOS 9 with your given solution,yet it is not working..:( – Dss May 17 '16 at 08:22