晚上好!
我正在与 Bloomberg 数据许可证 Web 服务集成,他们为我提供了 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 容器时遇到问题,它有自己的 keystore ,我使用 domain.xml 配置文件将其替换为 p12 keystore :
<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 删除了 keystore 密码,并收到错误:
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
我做错了什么以及如何让它发挥作用?
感谢任何帮助!
最佳答案
可能这不是一个好的解决方案,但是由于一天的 glassfish 配置试验不成功,我已经转向 Tommy EE,并且没有遇到此类问题。
关于java - Glassfish 使用 p12 keystore 覆盖 keystore ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26162519/