0

I have developed a app using worklight 6.2 targeting android and iOS, which should connect to the worklight server when the app starts. I did the following procedure.

  1. Developed an app in WL6.2
  2. Enabled the connectOnStartup parameter as true.
  3. Added android environment
  4. Run the app on worklight development server.
  5. Now opened the worklight console using https://ip:10080/worklightconsole, the app is working fine.
  6. Since i need https connection, i opened the worklight console as, https://ip:10043/worklightconsole. The console successfully opened and working fine.
  7. Now i am deployed the app on android emulator, and trying to connect the worklight server with http connection. The app can able to connect with worklight server.
  8. If the app is trying to connect to the worklight server with https, it is throwing the following error.

Error: The application failed connecting to the service.

The logcat is here

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
sasi
  • 512
  • 4
  • 27
  • Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found. This means you need to load the appropriate cert onto the device, or your worklight server needs a signed certificate rather than a self-signed. Good news is you are connecting to it though. – Gabe Sechan Aug 02 '14 at 05:46
  • How do i load the appropriate cert on the device? or how do i generate the signed certificate? – sasi Aug 02 '14 at 06:19
  • Try http://www.guyrutenberg.com/2013/03/16/manually-install-ssl-certificate-in-android-jelly-bean/ or http://stackoverflow.com/questions/4461360/how-to-install-trusted-ca-certificate-on-android-device – Gabe Sechan Aug 02 '14 at 06:20
  • Where can i found the certificate for worklight server? Do we need do create the certificate or we have it already. – sasi Aug 02 '14 at 06:32

1 Answers1

1

Please see my answer here, specifically the edit. If you just want to test your SSL connection internally, you will have to create your own certificate, so look at my answer to that question on how to do so. After you have it, you have to make your device trust that server certificate, so, again, look at my answer for the instructions.

Eventually, when you are going to production, you have to acquire a certificate from a trusted Certificate Authority (CA) such as Verisign, otherwise the devices where your application is installed will not trust your certificate and will not be able to connect.

Community
  • 1
  • 1
Daniel A. González
  • 1,225
  • 8
  • 11