嗨,我们在WAS 7.5生产环境中遇到问题,对于已实现google recaptcha的应用程序,我们遇到以下错误:

javax.net.ssl.SSLException:SSLSocketFactory为null。如果调用javax.net.ssl.SSLSocketFactory.getDefault()创建套接字并且未设置javax.net.ssl。*属性,则会发生这种情况。

我们有以下代码:

System.setProperty("javax.net.ssl.keyStoreType","jks");
System.setProperty("javax.net.ssl.trustStoreType","jks");
System.setProperty("javax.net.ssl.keyStore","/jks/ClientKeyStore.jks");
System.setProperty("javax.net.ssl.trustStore","/jks/ClientTrustStore.jks");
System.setProperty("javax.net.debug","ssl");
System.setProperty("javax.net.ssl.keyStorePassword","password$");
System.setProperty("javax.net.ssl.trustStorePassword","password$");

SSLSocketFactory sslsocketfactory = (SSLSocketFactory)
SSLSocketFactory.getDefault();


在我们的认证环境中,一切正常,有人遇到过类似的问题吗?提前致谢。

最佳答案

通过编辑JRE的java.security文件,更改了以下几行,此问题已解决:

# Default JSSE socket factories
ssl.SocketFactory.provider=com.ibm.jsse2.SSLSocketFactoryImpl
ssl.ServerSocketFactory.provider=com.ibm.jsse2.SSLServerSocketFactoryImpl
# WebSphere socket factories (in cryptosf.jar)
#ssl.SocketFactory.provider=com.ibm.websphere.ssl.protocol.SSLSocketFactory


#ssl.ServerSocketFactory.provider = com.ibm.websphere.ssl.protocol.SSLServerSocketFactory

重新启动应用服务器后,recaptcha代码便开始工作。

关于ssl - IBM WAS 7.5 SSLException SSLSocketFactory为空,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/55246502/

10-10 14:46