1

There is an old piece of code (not under my control) which initializes as sslContext.init(null, ...) - key manager is hard coded to be null. Later, the code will create a ssl server socket.

I am trying to provide a jks key store file to use certificate from. If I would be able to modify that code and feed the key manager then the code would work (I tried to copy over it).

My question is: How can I keep using that code, feeding null, and still use jks file of mine?

I have tried to set javax.net.ssl.keyStore, but that option is ignored. Javadoc says that in case key manager is null, the system will find appropriate one - what does that mean?

ItsPete
  • 2,363
  • 3
  • 27
  • 35
Alex Ber
  • 11
  • 2
  • The Javadoc is wrong. If you specify null you will get no key management. This is OK for a non-authenticating client, but useless for a server. You will have to create a `KeyManager` and provide it to the `SSLContext.` – user207421 Feb 27 '19 at 06:32
  • NB IBM's JDK works this way as described in the Javadoc. Oracle's does not. – user207421 Feb 27 '19 at 23:57

0 Answers0