服务器需要TLSv1,但CXF继续使用TLSv1.2,然后出现错误-客户端未启用或不支持协议版本

我在建立建立连接时应使用的协议方面遇到问题。服务器期望使用TLSv1,但是我不知何故不能使用它。

这是我的方法,用于连接WS端口,以便稍后在代码中使用它。

public static void connectToService(final String user,final char[] pass,boolean https,Object port,String url,String trustStorePath,char[] trustStorePassword,int responseTimeoutSeconds,int connTimeoutSeconds,String encryption) throws Exception {
    if (responseTimeoutSeconds==0) {
        responseTimeoutSeconds = 120;
    }
    if (connTimeoutSeconds==0) {
        connTimeoutSeconds = 120;
    }

    if (port==null) {
        throw new IllegalArgumentException("Service should not be null here. Cannot connect to service.");
    }

    if (user!=null) {//set authentication only if there is username set.

        Authenticator auth = new Authenticator() {
            public Passwordauthentication getPasswordauthentication() {
                logger.info("REQUESTING AUTHENTICATION!");
                logger.debug("username: {}",user);
                return (new Passwordauthentication(user,pass));
            }
        };
        Authenticator.setDefault(auth);
    }

    org.apache.cxf.endpoint.Client client = org.apache.cxf.frontend.ClientProxy.getclient(port);


    if (url != null)
        client.getRequestContext().put(Message.ENDPOINT_ADDRESS,url);
    String a = (String)client.getRequestContext().get(Message.ENDPOINT_ADDRESS);
    logger.info("URL: {}",a);
    Conduit conduit = client.getconduit();
    if (conduit instanceof org.apache.cxf.transport.http.HTTPConduit) {
        org.apache.cxf.transport.http.HTTPConduit httpConduit = (org.apache.cxf.transport.http.HTTPConduit) client.getconduit();

        if (https) {
            logger.debug("setting keystore");
            TLSClientParameters parameters = new TLSClientParameters();
            SSLParameters sslParameters = new SSLParameters();
            sslParameters.setProtocols(new String[] {"TLSv1"});
            try {
                if (trustStorePath!=null) {
                    logger.info("Trust store path set to: {}",trustStorePath);
                    KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
                    trustStore.load(new FileInputStream(trustStorePath),trustStorePassword);
                    logger.debug("Trust store loaded");
                    TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
                    tmf.init(trustStore);
                    logger.debug("Trust store factory initialized");

                    SSLContext sslContext = SSLContext.getInstance("TLSv1");//TLSv1.2
                    sslContext.init(null,tmf.getTrustManagers(),new SecureRandom());
                    sslContext.getSupportedSSLParameters().setProtocols(new String[] {"TLSv1"});
                    SSLContext.setDefault(sslContext);

                    logger.debug("SSLContext initialized with trust managers using SecureRandom");
                    SSLSocketFactory sslSocketFactory = sslContext.getsocketFactory();
                    parameters.setSSLSocketFactory(sslSocketFactory);
                    logger.debug("SSLSocketFactory updated.");
                } else {
                    logger.warn("Trust store path was null! SSL expected but path not provided. We will use default JAVA truststore.");
                }
            } catch (Exception e) {
                logger.error(e.getLocalizedMessage(),e);
            }
            parameters.setSecureSocketProtocol("TLSv1");
            httpConduit.setTlsClientParameters(parameters);
        }


        HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
        httpClientPolicy.setConnectionTimeout(connTimeoutSeconds*1000);
        httpClientPolicy.setallowChunking(false);
        httpClientPolicy.setReceiveTimeout(responseTimeoutSeconds*1000);
        httpClientPolicy.setautoRedirect(true);

        if (user!=null && pass!=null) {
            AuthorizationPolicy authorizationPolicy = new AuthorizationPolicy();
            authorizationPolicy.setusername(user);
            authorizationPolicy.setPassword(pass.toString());
            httpConduit.setauthorization(authorizationPolicy);
        }
        httpConduit.setClient(httpClientPolicy);
    } else if (conduit instanceof org.mule.module.cxf.transport.MuleUniversalConduit) {
        org.mule.module.cxf.transport.MuleUniversalConduit httpConduit = (org.mule.module.cxf.transport.MuleUniversalConduit) client.getconduit();
        logger.info("MuleUniversalConduit as cxf conduit");
    }
}

我尝试添加-Dhttps.protocols=TLSv1,TLSv1.2,TLSv1.3-Djdk.tls.client.protocols=TLSv1,然后尝试了许多其他选择,但无济于事。

如果在设置sslContext.createSSLEngine().beginHandshake();之后执行getSupportedSSLParameters().setProtocols(),则日志显示*** ClientHello,TLSv1,但是当实际请求发送到服务器时,它显示*** ClientHello,TLSv1.2

最让我困扰的是,只要我不向支持TLSv1.2的任何服务器发送请求,此代码就可以工作。

例如,我必须将请求发送到其他服务器。它们全部支持TLSv1.2,但其中一个仅支持TLSv1。如果我启动Java应用程序(Mule esb 3.7.0),并且将请求发送到版本为TLSv1的有问题的服务器,则建立连接并得到响应。然后,我向TLSv1.2版本的服务器发送请求,并得到响应。如果我再次尝试使用TLSv1版本连接到有问题的服务器,则会在以下异常中得到提示:

WARN  2019-11-16 21:28:55,934 [[wendingconsignation].HTTP_Listener_Configuration.worker.01] org.apache.cxf.phase.PhaseInterceptorChain: Interceptor for {http://tempuri.org/}WMUPWebService#{http://tempuri.org/}SomeMethodOnWS has thrown exception,unwinding now
org.apache.cxf.binding.soap.SoapFault: Problem writing SAAJ model to stream: Server chose TLSv1,but that protocol version is not enabled or not supported by the client.
    at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:223) ~[cxf-rt-bindings-soap-2.7.15.jar:2.7.15]
    at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:174) ~[cxf-rt-bindings-soap-2.7.15.jar:2.7.15]
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272) ~[cxf-api-2.7.15.jar:2.7.15]
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:572) ~[cxf-api-2.7.15.jar:2.7.15]
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:481) ~[cxf-api-2.7.15.jar:2.7.15]
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:382) ~[cxf-api-2.7.15.jar:2.7.15]
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:335) ~[cxf-api-2.7.15.jar:2.7.15]
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) ~[cxf-rt-frontend-simple-2.7.15.jar:2.7.15]
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:136) ~[cxf-rt-frontend-jaxws-2.7.15.jar:2.7.15]
    at com.sun.proxy.$Proxy87.vrniGuidOddajnegaPopisa(Unknown Source) ~[?:?]
    at com.test.infrastructure.MainProcessTransformer.transformMessage(MainProcessTransformer.java:79) ~[?:?]
    at com.test.helpers.AbstractMessageTransformer.process(AbstractMessageTransformer.java:23) ~[?:?]
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:94) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:56) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:80) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:76) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:94) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:56) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.AbstractInterceptingMessageProcessorBase.processnext(AbstractInterceptingMessageProcessorBase.java:98) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.AsyncInterceptingMessageProcessor.process(AsyncInterceptingMessageProcessor.java:102) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:94) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:56) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.AbstractInterceptingMessageProcessorBase.processnext(AbstractInterceptingMessageProcessorBase.java:98) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.construct.DynamicPipelineMessageProcessor.process(DynamicPipelineMessageProcessor.java:55) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:85) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:56) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:80) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:76) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:94) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:56) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.AbstractInterceptingMessageProcessorBase.processnext(AbstractInterceptingMessageProcessorBase.java:98) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.interceptor.AbstractEnvelopeInterceptor.processBlocking(AbstractEnvelopeInterceptor.java:58) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.AbstractRequestResponseMessageProcessor.process(AbstractRequestResponseMessageProcessor.java:47) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:94) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:56) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.AbstractInterceptingMessageProcessorBase.processnext(AbstractInterceptingMessageProcessorBase.java:98) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.AbstractFilteringMessageProcessor.process(AbstractFilteringMessageProcessor.java:41) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:94) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:56) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.AbstractInterceptingMessageProcessorBase.processnext(AbstractInterceptingMessageProcessorBase.java:98) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.AbstractRequestResponseMessageProcessor.processBlocking(AbstractRequestResponseMessageProcessor.java:56) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.AbstractRequestResponseMessageProcessor.process(AbstractRequestResponseMessageProcessor.java:47) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:85) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:56) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:80) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:76) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:50) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:76) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper.access$001(InterceptingChainLifecycleWrapper.java:22) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper$1.process(InterceptingChainLifecycleWrapper.java:66) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:61) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.construct.AbstractPipeline$3.process(AbstractPipeline.java:231) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.module.http.internal.listener.HttpMessageProcessorTemplate.routeEvent(HttpMessageProcessorTemplate.java:72) ~[mule-module-http-3.7.0.jar:3.7.0]
    at org.mule.execution.AsyncResponseFlowProcessingPhase$1.process(AsyncResponseFlowProcessingPhase.java:77) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.AsyncResponseFlowProcessingPhase$1.process(AsyncResponseFlowProcessingPhase.java:64) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.ExecuteCallbackinterceptor.execute(ExecuteCallbackinterceptor.java:16) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:35) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:22) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:67) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:110) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.AsyncResponseFlowProcessingPhase.runPhase(AsyncResponseFlowProcessingPhase.java:63) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.AsyncResponseFlowProcessingPhase.runPhase(AsyncResponseFlowProcessingPhase.java:38) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.PhaseExecutionEngine$InternalPhaseExecutionEngine.phaseSuccessfully(PhaseExecutionEngine.java:65) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.PhaseExecutionEngine$InternalPhaseExecutionEngine.phaseSuccessfully(PhaseExecutionEngine.java:69) ~[mule-core-3.7.0.jar:3.7.0]
    at com.mulesoft.mule.throttling.ThrottlingPhase.runPhase(ThrottlingPhase.java:185) ~[mule-module-throttling-ee-3.7.0.jar:3.7.0]
    at com.mulesoft.mule.throttling.ThrottlingPhase.runPhase(ThrottlingPhase.java:1) ~[mule-module-throttling-ee-3.7.0.jar:3.7.0]
    at org.mule.execution.PhaseExecutionEngine$InternalPhaseExecutionEngine.process(PhaseExecutionEngine.java:114) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.PhaseExecutionEngine.process(PhaseExecutionEngine.java:41) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.execution.MuleMessageProcessingManager.processMessage(MuleMessageProcessingManager.java:32) ~[mule-core-3.7.0.jar:3.7.0]
    at org.mule.module.http.internal.listener.DefaultHttpListener$1.handleRequest(DefaultHttpListener.java:126) ~[mule-module-http-3.7.0.jar:3.7.0]
    at org.mule.module.http.internal.listener.grizzly.GrizzlyRequestDispatcherFilter.handleRead(GrizzlyRequestDispatcherFilter.java:83) ~[mule-module-http-3.7.0.jar:3.7.0]
    at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) ~[grizzly-framework-2.3.21.jar:2.3.21]
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283) ~[grizzly-framework-2.3.21.jar:2.3.21]
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200) ~[grizzly-framework-2.3.21.jar:2.3.21]
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132) ~[grizzly-framework-2.3.21.jar:2.3.21]
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111) ~[grizzly-framework-2.3.21.jar:2.3.21]
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) ~[grizzly-framework-2.3.21.jar:2.3.21]
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536) ~[grizzly-framework-2.3.21.jar:2.3.21]
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) ~[grizzly-framework-2.3.21.jar:2.3.21]
    at org.mule.module.http.internal.listener.grizzly.ExecutorPerServerAddressIOStrategy.run0(ExecutorPerServerAddressIOStrategy.java:102) ~[mule-module-http-3.7.0.jar:3.7.0]
    at org.mule.module.http.internal.listener.grizzly.ExecutorPerServerAddressIOStrategy.access$100(ExecutorPerServerAddressIOStrategy.java:30) ~[mule-module-http-3.7.0.jar:3.7.0]
    at org.mule.module.http.internal.listener.grizzly.ExecutorPerServerAddressIOStrategy$WorkerThreadRunnable.run(ExecutorPerServerAddressIOStrategy.java:125) ~[mule-module-http-3.7.0.jar:3.7.0]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_181]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_181]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
Caused by: com.ctc.wstx.exc.WstxIOException: Server chose TLSv1,but that protocol version is not enabled or not supported by the client.
    at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:255) ~[woodstox-core-asl-4.4.1.jar:4.4.1]
    at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:215) ~[cxf-rt-bindings-soap-2.7.15.jar:2.7.15]
    ... 118 more
Caused by: javax.net.ssl.SSLHandshakeException: Server chose TLSv1,but that protocol version is not enabled or not supported by the client.
    at sun.security.ssl.ClientHandshaker.serverHello(ClientHandshaker.java:452) ~[?:1.8.0_181]
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:206) ~[?:1.8.0_181]
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1052) ~[?:1.8.0_181]
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:987) ~[?:1.8.0_181]
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1072) ~[?:1.8.0_181]
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385) ~[?:1.8.0_181]
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413) ~[?:1.8.0_181]
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397) ~[?:1.8.0_181]
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559) ~[?:1.8.0_181]
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1334) ~[?:1.8.0_181]
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1309) ~[?:1.8.0_181]
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:259) ~[?:1.8.0_181]
    at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.setupWrappedStream(URLConnectionHTTPConduit.java:174) ~[cxf-rt-transports-http-2.7.15.jar:2.7.15]
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1289) ~[cxf-rt-transports-http-2.7.15.jar:2.7.15]
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1245) ~[cxf-rt-transports-http-2.7.15.jar:2.7.15]
    at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.onFirstWrite(URLConnectionHTTPConduit.java:201) ~[cxf-rt-transports-http-2.7.15.jar:2.7.15]
    at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:47) ~[cxf-api-2.7.15.jar:2.7.15]
    at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69) ~[cxf-api-2.7.15.jar:2.7.15]
    at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:100) ~[woodstox-core-asl-4.4.1.jar:4.4.1]
    at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:241) ~[woodstox-core-asl-4.4.1.jar:4.4.1]
    at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:253) ~[woodstox-core-asl-4.4.1.jar:4.4.1]
    at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:215) ~[cxf-rt-bindings-soap-2.7.15.jar:2.7.15]
    ... 118 more

任何帮助将不胜感激,因为我已经花了很多时间在此上,并且我尝试了许多不同的方法来实现它。我仍然可以选择为此服务器创建微服务,该服务将转发我的请求,但会增加整个系统的复杂性。谢谢!

InitialQwertyJGW 回答:服务器需要TLSv1,但CXF继续使用TLSv1.2,然后出现错误-客户端未启用或不支持协议版本

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3088402.html

大家都在问