我正在使用Spring SAML在我的应用程序中实现单点登录。 Evreything从SSO角度进行整合和正常工作。 也通过轴使用HTTP客户端后我的应用程序的另一种服务开始与下面的错误Spring SAML配置正在破坏其他http连接
{} http://xml.apache.org/axis/失败的堆栈跟踪:javax.net.ssl.SSLPeerUnverifiedException:SSL对失败的主机名名称验证:空
我已经看了答案提供的链接 Spring Security SAML + HTTPS to another page并遵循相同,但无济于事。
下面是TLSProtocolSocketFactory
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetClass" value="org.apache.commons.httpclient.protocol.Protocol"/>
<property name="targetMethod" value="registerProtocol"/>
<property name="arguments">
<list>
<value>https</value>
<bean class="org.apache.commons.httpclient.protocol.Protocol">
<constructor-arg value="https"/>
<constructor-arg>
<bean class="org.springframework.security.saml.trust.httpclient.TLSProtocolSocketFactory">
<constructor-arg ref="keyManager"/>
<constructor-arg><null/></constructor-arg>
<constructor-arg value="allowAll"/>
</bean>
</constructor-arg>
<constructor-arg value="443"/>
</bean>
</list>
</property>
</bean>
我已经导入了其他服务的证书在samlKeystore.jks以及配置。
在问题的任何帮助将apreciated
谢谢@ blur0224。我在上面的问题中发布了相同的链接,并遵循了指示。即使删除了上述bean,我也得到了异常'code' faultDetail: {http://xml.apache.org/axis/}stackTrace:javax.net.ssl.SSLException:主机名验证错误 at org。 opensaml.ws.soap.client.http.TLSProtocolSocketFactory.verifyHostname(TLSProtocolSocketFactory.java:153) at org.opensaml.ws.soap.client.http.TLSProtocolSocketFactory.createSocket(TLSProtocolSocketFactory。java:118) –
如果您尝试使用具有自签名证书的java连接到webservice,也可能会出现此错误。 Java需要通过将它添加到JKS来显式信任该证书。是否有可能在同一时间转换为不同的JDK或更新为新的JDK,但可能没有加载该CA? – blur0224
我拥有在samkeystore.jks和jre cacerts中加载的站点CA.一个观察我已经看到,当我使用Spring TLSSocketProtocolFcatory比在Opensaml的verifyHostname函数TLSProtocolFactory主机出来时总是从空的时候sslsesion.getPeerHost()... –