RestEasy - 无法调用请求 - RESTEASY004655 - SSL异常

时间:2018-04-11 07:17:04

标签: java ssl resteasy

我正在尝试使用disableTrustManager轻松创建客户端并禁用SSL。但它不起作用。我正在

  

无法调用请求 - RESTEASY004655

这是客户端创建代码

private Client client = new ResteasyClientBuilder()
                        .disableTrustManager()
                        .defaultProxy(proxyHost, proxyPort)
                        .build();
WebTarget webTarget = client.target("URL");
Response response = webTarget.request(MediaType.APPLICATION_XML)
                .post(Entity.entity(requestFileContent, MediaType.APPLICATION_OCTET_STREAM));

异常堆栈跟踪

  

javax.ws.rs.ProcessingException:RESTEASY004655:无法调用请求    \ n \ tat org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:289) \ n \ tat     org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:454)\ n \达     org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.post(ClientInvocationBuilder.java:193)\ n \达     COM。 .vertical.causes.kermit。样品。 SampleRequestSubmitter.submitRequestFile(SampleRequestSubmitter.java:59)\n\tat     COM。 .vertical.causes.kermit。样品。 SampleUtil.upload SampleFile(SampleUtil.java:551)\n\tat     COM。 .vertical.causes.kermit。样品。 SampleUtil.upload SampleEligibleClaims(SampleUtil.java:518)\n\tat     COM。 .vertical.causes.kermit.CauseReadImpl.upload SampleEligibleClaims(CauseReadImpl.java:6130)\ n \ tat     sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\ n \ tat     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\ n \达     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\ n \达     java.lang.reflect.Method.invoke(Method.java:497)\ n \ tat org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)\ n \ tat      org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:294)\ n \达      org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:248)\ n \达       org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:235)\ n \达       org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:402)\ n \达       org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:209)\ n \达       org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)\ n \达        org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)\ n \达        org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)\ n \达        javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\ n \达        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)\ n \达        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\ n \达        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)\ n \达        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\ n \达        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\ n \达        COM。 .platform.service.rest.CoreContextFilter.doFilter(CoreContextFilter.java:75)\ n \达        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\ n \达         org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\ n \达          COM。 .raptor.web.filters.SSLApplicationFilter.doFilter(SSLApplicationFilter.java:57)\ n \达          org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\ n \达          org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\ n \达          COM。 .raptor.web.filters.SSLValidateInternalsFilter.doFilter(SSLValidateInternalsFilter.java:70)\ n \达          org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\ n \达          org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\ n \达          COM。 .platform.service.rest.logging.OuterTransactionCalFilter.doFilter(OuterTransactionCalFilter.java:124)\ n \达           org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\ n \达            org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\ n \达            org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)\ n \达            org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\ n \ tat org.apache.catalina.core.Appli

我想跳过此客户端的SSL验证。有人可以帮助我。

来自restEasy文件

  

/ **       *禁用信任管理和主机名验证。 注意这是一种安全措施       * hole,所以只有在你不能或不想验证身份时才设置此选项       *您正在与之沟通的主持人。       * /      public ResteasyClientBuilder disableTrustManager()

0 个答案:

没有答案