java CXF xml 配置不使用 disableCNcheck="true" 进行验证

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5875716/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 13:13:47  来源:igfitidea点击:

CXF xml config doesnt validate using disableCNcheck="true"

javaxmlcxf

提问by bwsmith

I'm using a CXF config file copied directly from the CXF website at: cxf.apache.org/docs/client-http-transport-including-ssl-support.html

我使用的是直接从 CXF 网站复制的 CXF 配置文件:cxf.apache.org/docs/client-http-transport-including-ssl-support.html

However when I run my program the XML does not validate. The error given is: Attribute 'disableCNcheck' is not allowed to appear in element 'http-conf:tlsClientParameters'

但是,当我运行我的程序时,XML 不会验证。给出的错误是:属性“disableCNcheck”不允许出现在元素“http-conf:tlsClientParameters”中

We are using self-signed certificates in a test environment and just need a quick workaround to use the services!

我们在测试环境中使用自签名证书,只需要一个快速的解决方法来使用这些服务!

Here is the cxf.xml file I am trying to use, any help is appreciated!

这是我正在尝试使用的 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>

回答by Daniel Kulp

The attribute should be disableCNCheck (capital C on Check). I believe just fixing that should fix the issue.

该属性应为 disableCNCheck(Check 上的大写 C)。我相信只要修复就可以解决问题。