IceSSL NullPointerException (java)

241 Views Asked by At

I'm developing an application using ICE middleware. I have problem with IceSSL. After configuring both client and server like that:

Ice.Plugin.IceSSL=IceSSL.PluginFactory
IceSSL.DefaultDir=.
IceSSL.Keystore=ssl/s/s.jks
IceSSL.Password=qwerty
IceSSL.Truststore=ssl/s/s.jks

I am getting such an error:

 -- 23.05.12 10:57:55:913 ServerApplication: Network: accepting ssl connection
   local address = 127.0.0.1:10001
   remote address = 127.0.0.1:65415
!! 23.05.12 10:57:56:086 ServerApplication: error: Ice.ThreadPool.Server-0: exception in `Ice.ThreadPool.Server':
   java.lang.NullPointerException
    at IceInternal.Network.addrToString(Network.java:1044)
    at IceSSL.TransceiverI.initialize(TransceiverI.java:60)
    at Ice.ConnectionI.initialize(ConnectionI.java:1831)
    at Ice.ConnectionI.message(ConnectionI.java:1038)
    at IceInternal.ThreadPool.run(ThreadPool.java:302)
    at IceInternal.ThreadPool.access$300(ThreadPool.java:12)
    at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:643)
    at java.lang.Thread.run(Unknown Source)

   event handler: local address = 127.0.0.1:10001
   remote address = 127.0.0.1:65415

Have anyone know how to fix this?

1

There are 1 best solutions below

0
On

I had the same problem after wrongly adding certificates to the keystore. If you look at the output of keytool -list -keystore yourkeystore.jsk, you'll see the list of certificates. In my case both were listed as trustedCertEntry (this is afaik how keytool shows certs without a private key).

Enter keystore password:  

(...)
Your keystore contains 2 entries

cacert, May 23, 2012, trustedCertEntry, 
Certificate fingerprint (SHA1): 47:...:5C
rsakey, May 23, 2012, trustedCertEntry, 
Certificate fingerprint (SHA1): D2:...:61

Your cert should probably be listed as PrivateKeyEntry, and CA's as trustedCertEntry.

You can try to generate the certificate using keytool only. It worked in my case. Hope it helps.