Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Glassfish使用p12密钥库覆盖密钥库_Java_Ssl Certificate_Glassfish 4 - Fatal编程技术网

Java Glassfish使用p12密钥库覆盖密钥库

Java Glassfish使用p12密钥库覆盖密钥库,java,ssl-certificate,glassfish-4,Java,Ssl Certificate,Glassfish 4,晚上好 我正在与Bloombergs数据许可证Web服务集成,他们为我提供了p12密钥库。在普通java应用程序中,它通过提供以下功能完美工作: System.setProperty("javax.net.ssl.keyStore", "[path_2_certificate]"); System.setProperty("javax.net.ssl.keyStorePassword", "[password]"); System.setProperty("javax.net.ssl.keySt

晚上好

我正在与Bloombergs数据许可证Web服务集成,他们为我提供了p12密钥库。在普通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容器有自己的密钥库,我使用domain.xml配置文件将其替换为p12密钥库,但遇到了问题:

<jvm-options>-Djavax.net.ssl.keyStore=${com.sun.aas.instanceRoot}\config\uDLWSCert.p12</jvm-options>
<jvm-options>-Djavax.net.ssl.keyStoreType=pkcs12</jvm-options>
我做错了什么,如何让它工作


感谢您的帮助

可能这不是一个好的解决方案,但由于一天的glassfish配置试验失败,我搬到了Tommy EE,并没有出现这种问题。

晚了,但对其他人来说:pkcs12总是加密的。如果您在openssl pkcs12-export提示时点击了return,它将使用空密码进行加密。Java crypto通常JCE可以解密/打开这样的存储,但JSSE默认存储似乎无法解密/打开,即使您设置了…keystrepassword,因为代码会显式忽略空设置。因此,配置和使用非空密码应该是可行的。
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