Search code examples
sslibm-mobilefirstself-signed

Worklight 6.2 Developer Server - Self Signed SSL


We have a HTTPS RESTFul service running in IIS. We are able to successfully call it using the browser. However, when we call the service from a worklight adapter, we are getting the following exception:

"javax.net.ssl.SSLPeerUnverifiedException"

The worklight adapter was working perfectly fine when we were using HTTP instead of HTTPS.

We have followed all the steps mentioned in the documentation:

  1. Create certificate using keytool in the IIS server. Bind it to the RestFul service.
  2. Exporting the public key to a .cert file
  3. Importing the file into Worklight keystore
  4. Mentioned https as the protocol in the adapter.xml.

We have even verified the default.keystore of the worklight, it is matching with the certificate present in the IIS server.

We don't need mutual authentication. We just want to use SSL in the RestFul service deployed in the IIS.

Thanks, Pavan


Solution

  • You forgot to add the certificate to your device's trust store. Since it is self signed, devices will not trust them by default. To do so, follow the steps here for your device's OS: http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.installconfig.doc/admin/c_ssl_config.html?lang=en

    Specifically, look at this for iOS and this one for Android.