java - Glassfish 使用 p12 keystore 覆盖 keystore

标签 java ssl-certificate glassfish-4

晚上好!

我正在与 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/

相关文章:

java - 如何仅点击一次库存项目

Tomcat SSL 实现未在浏览器中显示证书链

ssl - openssl 输出主题行中的加号 (+) 是什么意思?

java - 重新启动 GlassFish 4 的正确方法是什么?

java - 无法抑制 jar 中的日志输出

java - 批量选择记录 Spring JDBCTemplate

java - Apache Commons Ftp 文件上传 0 字节

java - 如何使用 Spring boot 配置受信任的 SSL keystore ?

mysql - 为什么我无法从 JDBC 连接池 ping 我的数据库?

java - 使用 Netbeans 添加自定义外观