2
我正在使用从CXF网站直接复制的CXF配置文件: cxf.apache.org/docs/client-http-transport-including-ssl-support .htmlCXF xml配置不验证使用disableCNcheck =“true”
但是,当我运行我的程序XML不验证。给出的错误是: 属性'disableCNcheck'不允许出现在元素'http-conf:tlsClientParameters'中
我们在测试环境中使用自签名证书,只需要快速的解决方法即可使用服务!
这里是我尝试使用的cxf.xml文件,任何帮助表示赞赏!
<http-conf:conduit
name="{https://hostname/service}MyService.http-conduit">
<!-- deactivate HTTPS url hostname verification (localhost, etc)
WARNING ! disableCNcheck=true should NOT be used in production-->
<http-conf:tlsClientParameters disableCNcheck="true" />
</http-conf:conduit>
该错字修复了验证,但是,当标签丢失时抛出相同的异常:java.io.IOException:https URL主机名与服务器证书上的通用名称(CN)不匹配。要禁用此检查(不推荐用于生产),请将CXF客户端TLS配置属性“disableCNCheck”设置为true。 – bwsmith 2011-05-06 02:52:30
这可能是由于http-conf:管道上的“名称”。有两件事要尝试。 1){https:// hostname/service} MyServicePort.http-conduit,因为它应该是服务中的PORT名称,而不是服务名称。或2)name =“http://www.blah.com/.*”来对URL进行正则表达式。 – 2011-05-06 02:56:48
那么,该评论中的网址无效。 :-( – 2011-05-06 02:58:27