Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6761

JAX-RS ClientImpl does not set TLSClientParameters on HTTPConduit when only HostnameVerifier is configured

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.4
    • Fix Version/s: 3.1.5, 3.0.8, 3.2.0
    • Component/s: JAX-RS
    • Labels:
      None
    • Estimated Complexity:
      Novice

      Description

      org.apache.cxf.jaxrs.client.spec.ClientImpl only copies the TLSClientParameters configured by ClientBuilder.newBuilder().hostnameVerifier(HostnameVerifier) if an SSLSocketFactory or TrustManagers are configured.

      This makes it impossible to use a custom HostnameVerifier without also declaring a custom SSLSocketFactory or TrustManagers.

      Snip of incorrect code from rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java, line 282

                  // TLS
                  TLSClientParameters tlsParams = secConfig.getTlsClientParams();
                  if (tlsParams.getSSLSocketFactory() != null 
                      || tlsParams.getTrustManagers() != null) {
                      clientCfg.getHttpConduit().setTlsClientParameters(tlsParams);
                  }
      

      Proposed replacement:

                  // TLS
                  TLSClientParameters tlsParams = secConfig.getTlsClientParams();
                  if (tlsParams.getSSLSocketFactory() != null 
                      || tlsParams.getTrustManagers() != null
                      || tlsParams.getHostnameVerifier() != null) {
                      clientCfg.getHttpConduit().setTlsClientParameters(tlsParams);
                  }
      

        Attachments

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              chribble Chris Ribble
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 3h
                3h
                Remaining:
                Remaining Estimate - 3h
                3h
                Logged:
                Time Spent - Not Specified
                Not Specified