ssl - Which keystore is used when null is passed to KeyManagerFactory.init() in Java? -


when execute following code:

keymanagerfactory keymanagerfactory = keymanagerfactory                              .getinstance(keymanagerfactory.getdefaultalgorithm()); keymanagerfactory.init(null, null); 

and subsequent establishment of ssl connection, exception in thread "main" javax.net.ssl.sslhandshakeexception: received fatal alert: handshake_failure , not nullpointerexception or something. keystore used then? or npe hidden?

when null used keystore argument of keymanagerfactory.init(..., ...), no keystore used (it's in fact using an empty list internally).

there's no "hidden" nullpointerexception such, , there's no reason why there should one. of course, using null value here , empty collection has consequences when trying use keymanager, not ssl/tls connections require keystore (e.g. client-side without client certificate or anonymous cipher suites).

(note that, although there no default value keystore, there 1 truststore, default value used trustmanagerfactory.init(null).)


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -