Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Corrupt keystore?

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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");
 
Ranch Hand
Posts: 820
IntelliJ IDE VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
What's gotten into you? Could it be this tiny ad?
The trailboss has a kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic