1

Good evening!

I am integrating with Bloombergs Data License Web Services, they provided me with p12 keystore. In normal java app, it works perfectly by providing:

System.setProperty("javax.net.ssl.keyStore", "[path_2_certificate]");
System.setProperty("javax.net.ssl.keyStorePassword", "[password]");
System.setProperty("javax.net.ssl.keyStoreType", "pkcs12");

Now I would like to put into a web app which runs under Glassfish 4.0.

I am having troubles with Glassfish Web Container which has its own keystore, which I am replacing with p12 keystore using domain.xml config file:

<jvm-options>-Djavax.net.ssl.keyStore=${com.sun.aas.instanceRoot}\config\uDLWSCert.p12</jvm-options>
<jvm-options>-Djavax.net.ssl.keyStoreType=pkcs12</jvm-options>

I have removed keystore password using openssl, and getting errors:

SEVERE: Exception while deploying the app [AwesomeApp] : A MultiException has 6 exceptions.  They are:
1. java.lang.IllegalStateException: java.io.IOException: failed to decrypt safe contents entry: javax.crypto.BadPaddingException: Given final block not properly padded
2. java.lang.IllegalStateException: Unable to perform operation: create on com.sun.enterprise.security.ssl.impl.SecuritySupportImpl
3. java.lang.IllegalArgumentException: While attempting to resolve the dependencies of com.sun.enterprise.security.ssl.SSLUtils errors were found
4. java.lang.IllegalStateException: Unable to perform operation: resolve on com.sun.enterprise.security.ssl.SSLUtils
5. java.lang.IllegalArgumentException: While attempting to resolve the dependencies of com.sun.enterprise.security.SecurityLifecycle errors were found
6. java.lang.IllegalStateException: Unable to perform operation: resolve on com.sun.enterprise.security.SecurityLifecycle

What I am doing wrong and how to get it to work?

Any help is appreciated!

Jake OS
  • 180
  • 1
  • 16
  • Late but for anyone else: pkcs12 is always encrypted. If you just hit return when prompted by `openssl pkcs12 -export` it encrypts with an *empty* password. Java crypto in general (JCE) can decrypt/open such a store, but it appears the *JSSE default store* cannot, even if you set `...keyStorePassword`, because of code that explicitly ignores an empty setting. So it should work to configure (and use) a nonempty password. – dave_thompson_085 Oct 15 '14 at 09:01

1 Answers1

0

May be this is not a good solution, but as a day of trials with glassfish configurations went unsuccessfully, I had moved to Tommy EE, and did not have this kind of a problem.

Jake OS
  • 180
  • 1
  • 16