2014-10-02 66 views
1

晚上好!Glassfish使用p12 keystore覆盖keystore

我正在与Bloombergs Data License Web Services集成,他们向我提供了p12 keystore。在正常的Java应用程序,它完美的作品提供:

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

现在我想投入其中的Glassfish 4.0下运行的Web应用程序。

我有Glassfish的Web容器有自己的密钥库,其中我与P12密钥库使用的domain.xml配置文件替换的烦恼:

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

我一直在使用OpenSSL的删除密钥库的密码,并收到错误信息:

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 

我在做什么错误以及如何让它工作?

任何帮助表示赞赏!

+0

迟到,但对于其他人:pkcs12始终是加密的。如果您在'openssl pkcs12 -export'提示时按回车键,则会使用*空*密码进行加密。通常情况下,Java加密(JCE)可以解密/打开这样的存储,但即使您设置了“... keyStorePassword”,由于显式忽略空设置的代码,它看起来* JSSE默认存储*不能。所以它应该能够配置(并使用)非空密码。 – 2014-10-15 09:01:00

回答

0

可能这不是一个好的解决方案,但作为一天的玻璃鱼配置试验失败了,我搬到了汤米EE,并没有这种问题。