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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.1.4
    • 3.1.5, 3.0.8, 3.2.0
    • JAX-RS
    • None
    • 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

            sergey_beryozkin Sergey Beryozkin
            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