Results 1 to 8 of 8

Thread: Android and ICE properties file

  1. #1
    bhaveshbp is offline Registered User
    Name: Bhaves Patel
    Organization: HomeRunner
    Project: Automation
    Join Date
    May 2011
    Posts
    4

    Android and ICE properties file

    Im creating an Android application that will use an ICE properties file. The file is being read in like this:

    private SessionFactoryHelper factoryHelper;
    private SessionHelper sessionHelper;
    Ice.InitializationData initData = new Ice.InitializationData();
    initData.properties = Ice.Util.createProperties();
    initData.properties.load("/dev/ice.cfg");
    factoryHelper = new SessionFactoryHelper(initData, this);

    I am ussing Glacier2 and SSL so I have these properties set in my properties file:
    IceSSL.DefaultDir=dev/ice_certs
    IceSSL.Keystore=client.jks


    I'm using a SessionFactoryHelper to connect to my Glacier2 router:
    sessionHelper = factoryHelper.connect(uname, pass);


    Problem is I can't get it to connect to the router, when I call connect on factoryHelper it throws:

    Ice.PluginInitializationException
    reason = "IceSSL: unable to load keystore:
    client.jks"

    I manually pushed all the certificates to the Android emulator using adb, and they exist under /dev/ice_certs because if I look on the file system on the Android emulator I can see the files. The permissions on the files are also correct.

    Also I know the /dev/ice_certs mount is accessible because if I change the IceSSL.DefaultDir property to some garbage mount such as "/bogusmout/ice_certs" the exception thrown by the connect function changes to:
    Ice.PluginInitializationException
    reason = "IceSSL: keystore not found:
    client.jks"

    Which means that in the previous case the client.jks was being found but wasn't loadable for some reason.


    Any ideas?

    Thanks.

  2. #2
    xdm's Avatar
    xdm
    xdm is offline ZeroC Staff
    Name: Jose Gutierrez de la Concha
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Sep 2003
    Location
    La Coruņa, Spain
    Posts
    588
    PHP Code:
    IceSSL.DefaultDir=dev/ice_certs 
    Seems that you missed a slash at the beginning of this property value

  3. #3
    bhaveshbp is offline Registered User
    Name: Bhaves Patel
    Organization: HomeRunner
    Project: Automation
    Join Date
    May 2011
    Posts
    4
    I have tried that already also. I get the same exception.

  4. #4
    xdm's Avatar
    xdm
    xdm is offline ZeroC Staff
    Name: Jose Gutierrez de la Concha
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Sep 2003
    Location
    La Coruņa, Spain
    Posts
    588
    This indicate an IOException. You can get more info from the exception cause.

    Try to catch the exception and print the cause stack trace.
    Code:
    catch(Ice.PluginInitializationException ex)
    {
        ex.getCause().printStackTrace();
    }

  5. #5
    bhaveshbp is offline Registered User
    Name: Bhaves Patel
    Organization: HomeRunner
    Project: Automation
    Join Date
    May 2011
    Posts
    4
    Looks like a problem with my keys, this is what the stack trace said:

    java.io.IOException: Wrong version of key store.

  6. #6
    xdm's Avatar
    xdm
    xdm is offline ZeroC Staff
    Name: Jose Gutierrez de la Concha
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Sep 2003
    Location
    La Coruņa, Spain
    Posts
    588
    Seems that you need to set the properties

    IceSSL.TruststoreType
    IceSSL.KeystoreType

    The default depends on the JVM, valid values are "JKS", "PKCS12" and "BKS"

    Also note that IceSSL require using Android Froyo or later. See Ice Android demos for examples of how to conditional configure IceSSL

  7. #7
    xdm's Avatar
    xdm
    xdm is offline ZeroC Staff
    Name: Jose Gutierrez de la Concha
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Sep 2003
    Location
    La Coruņa, Spain
    Posts
    588
    Also note that Android don't support JKS, you should use BKS instead

  8. #8
    bhaveshbp is offline Registered User
    Name: Bhaves Patel
    Organization: HomeRunner
    Project: Automation
    Join Date
    May 2011
    Posts
    4
    Yup that is the problem my key store is in JKS format.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Ice for Android 0.2.0 released
    By mes in forum Announcements
    Replies: 0
    Last Post: 02-08-2011, 04:32 PM
  2. config file properties
    By Greenhippo in forum Help Center
    Replies: 3
    Last Post: 01-16-2007, 03:07 AM
  3. Typo in Java Glacier2 demo properties file?
    By bartley in forum Bug Reports
    Replies: 2
    Last Post: 02-09-2006, 04:35 PM
  4. Loading properties file in MFC sample
    By Kruppy in forum Help Center
    Replies: 6
    Last Post: 11-08-2005, 03:01 PM
  5. set config properties w/o config file
    By dkey in forum Help Center
    Replies: 3
    Last Post: 05-08-2005, 05:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •