This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Corrupt keystore?

 
Mark Fraser
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Our host recently performed a server migration (mirror of the old environment) but now I can't load the keystore, even though the SSL setup still works.

My problem is when I try to load the keystore to access the private key I get a null pointer exception. The keystore documentation doesn't mention a null pointer exception but I've seen this error before when I tried using the wrong password. If the environment is a mirror of the old environment then the password, etc. should all be the same. Can anyone suggest what may have happened?

In the code below, the "KeyStore loaded" string doesn't get logged.

if (Security.getProvider("BC") == null) {
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
}

// Read the Private Key
KeyStore ks = KeyStore.getInstance("PKCS12", "BC");
logger.info("KeyStore: " + ks);
FileInputStream fis = new FileInputStream(certificatePath);
logger.info("FileInputStream: " + fis);
ks.load(fis, privateKeyPassword.toCharArray());
logger.info("KeyStore loaded");
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you contact your host?


It looks like one of fis or privateKeyPassword is null, right? Can you do something to figure out which is null?
 
Mark Fraser
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem turned out to be they didn't copy the upgraded signed security policy jar files from the old server.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic