gpt4 book ai didi

web-services - 使用Grails Cxf客户端插件设置disableCNCheck

转载 作者:行者123 更新时间:2023-12-02 15:32:36 25 4
gpt4 key购买 nike

我正在尝试将我的Web服务的disableCNCheck设置为true。我正在使用带有Cxf客户端插件的Grails 2.2.0。

我发现了这个问题:
wsdl2java CXF command line error about disableCNCheck option

这段代码:

protected void disableCNCheck(Object port) {
Client client = ClientProxy.getClient(port)

TLSClientParameters params = new TLSClientParameters()
params.setDisableCNCheck(true)
HTTPConduit httpConduit = (HTTPConduit) client?.getConduit()
httpConduit?.setTlsClientParameters(params)
}

该代码属于哪个类,该方法将在哪里调用?是否可以代替为Cxf Client插件设置配置参数?

最佳答案

通过将下面的xml配置添加到grails-app / conf / spring / resources.xml [Grails 2.2.3,cxf-client插件1.6.1中,您可以使用代码来代替disableCNCheck。

<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:http="http://cxf.apache.org/transports/http/configuration"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd
">

<http:conduit name="*.http-conduit">
<http:tlsClientParameters disableCNCheck="true" />
</http:conduit>

</beans>

关于web-services - 使用Grails Cxf客户端插件设置disableCNCheck,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17117639/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com