我继续在tRESTClient中收到下面提到的错误。
Exception in component tRESTClient
javax.ws.rs.ProcessingException:java.io.IOException:IOException:https://www.websitename.com/api-v1/login:https URL主机名与客户端信任库中服务器证书上的公用名(CN)不匹配。确保服务器证书正确,或禁用此检查(不建议用于生产)设置CXF客户端TLS配置属性" disableCNCheck"为真。 at org.apache.cxf.jaxrs.client.AbstractClient.checkClientException(AbstractClient.java:582) 在org.apache.cxf.jaxrs.client.AbstractClient.preProcessResult(AbstractClient.java:564) 在org.apache.cxf.jaxrs.client.WebClient.doResponse(WebClient.java:1144) 在org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1094) 在org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:894) 在org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:865) 在org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:428) 在org.apache.cxf.jaxrs.client.WebClient.post(WebClient.java:458)
[WARN]:org.apache.cxf.phase.PhaseInterceptorChain - {https://www.websitename.com/api-v1/login的拦截器?} tRESTClient抛出异常,现在展开 org.apache.cxf.interceptor.Fault:无法发送消息。 at org.apache.cxf.interceptor.MessageSenderInterceptor $ MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64) 在org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) 在org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:649) 在org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1093) 在org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:894) 在org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:865) 在org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:428) 在org.apache.cxf.jaxrs.client.WebClient.post(WebClient.java:458) at local_project.apicalltest_0_1.ApiCallTest.tWriteJSONField_1_InProcess(ApiCallTest.java:2062) at local_project.apicalltest_0_1.ApiCallTest $ 1ThreadXMLField_tWriteJSONField_1_Out.run(ApiCallTest.java:563) at local_project.apicalltest_0_1.ApiCallTest.tWriteJSONField_1_InProcess(ApiCallTest.java:2062) at local_project.apicalltest_0_1.ApiCallTest $ 1ThreadXMLField_tWriteJSONField_1_Out.run(ApiCallTest.java:563) 引发者:java.io.IOException:IOException调用https://www.websitename.com/api-v1/login:https URL主机名与客户端信任库中服务器证书上的公用名(CN)不匹配。确保服务器证书正确,或禁用此检查(不建议用于生产)设置CXF客户端TLS配置属性" disableCNCheck"为真。 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.apache.cxf.transport.http.HTTPConduit $ WrappedOutputStream.mapException(HTTPConduit.java:1376) at org.apache.cxf.transport.http.HTTPConduit $ WrappedOutputStream.close(HTTPConduit.java:1360) 引发者:java.io.IOException:IOException调用https://www.websitename.com/api-v1/login:https URL主机名与客户端信任库中服务器证书上的公用名(CN)不匹配。确保服务器证书正确,或禁用此检查(不建议用于生产)设置CXF客户端TLS配置属性" disableCNCheck"为真。 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.apache.cxf.transport.http.HTTPConduit $ WrappedOutputStream.mapException(HTTPConduit.java:1376) at org.apache.cxf.transport.http.HTTPConduit $ WrappedOutputStream.close(HTTPConduit.java:1360) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:651) at org.apache.cxf.interceptor.MessageSenderInterceptor $ MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:651) at org.apache.cxf.interceptor.MessageSenderInterceptor $ MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) 在org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) 在org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:649) 在org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1093) ......还有6个 引发者:java.io.IOException:https URL主机名与客户端信任库中服务器证书上的公用名(CN)不匹配。确保服务器证书正确,或禁用此检查(不建议用于生产)设置CXF客户端TLS配置属性" disableCNCheck"为真。 at org.apache.cxf.transport.http.HTTPConduit $ WrappedOutputStream.onFirstWrite(HTTPConduit.java:1282) at org.apache.cxf.transport.http.URLConnectionHTTPConduit $ URLConnectionWrappedOutputStream.onFirstWrite(URLConnectionHTTPConduit.java:267) ......还有9个 引发者:java.io.IOException:https URL主机名与客户端信任库中服务器证书上的公用名(CN)不匹配。确保服务器证书正确,或禁用此检查(不建议用于生产)设置CXF客户端TLS配置属性" disableCNCheck"为真。 at org.apache.cxf.transport.http.HTTPConduit $ WrappedOutputStream.onFirstWrite(HTTPConduit.java:1282) at org.apache.cxf.transport.http.URLConnectionHTTPConduit $ URLConnectionWrappedOutputStream.onFirstWrite(URLConnectionHTTPConduit.java:267) at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:47) at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69) at org.apache.cxf.transport.http.HTTPConduit $ WrappedOutputStream.close(HTTPConduit.java:1332) ......还有12个 at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:47) at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69) at org.apache.cxf.transport.http.HTTPConduit $ WrappedOutputStream.close(HTTPConduit.java:1332) ......还有12个
答案 0 :(得分:0)
https URL主机名与客户端信任库中服务器证书上的公用名(CN)不匹配。确保服务器证书正确,或禁用此检查(不建议用于生产)将CXF客户端TLS配置属性“disableCNCheck”设置为true
您尝试使用SSL访问的网站没有有效的SSL证书。该消息表明证书CN与网站URL不匹配,这使其无效。
如果您控制网站,请为其生成有效证书;否则你将不得不重写Java的安全机制,如消息中所述。不建议这样做。