Uploaded image for project: 'HttpComponents HttpCore'
  1. HttpComponents HttpCore
  2. HTTPCORE-664

WARNING: Illegal reflective access by org.apache.hc.core5.util.ReflectionUtils$1 (file:/mnt/blah.jar) to method sun.security.ssl.SSLEngineImpl.getApplicationProtocol()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 5.0.3
    • None
    • HttpCore
    • None
    • Java 11

    Description

      Using httpcore5 with Java 11, we noticed the code is reporting the following warning reported by the JVM:

      11:50:19 WARNING: An illegal reflective access operation has occurred
      11:50:19 WARNING: Illegal reflective access by org.apache.hc.core5.util.ReflectionUtils$1 (file:/mnt/blah.jar) to method sun.security.ssl.SSLEngineImpl.getApplicationProtocol()
      11:50:19 WARNING: Please consider reporting this to the maintainers of org.apache.hc.core5.util.ReflectionUtils$1
      11:50:19 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
      11:50:19 WARNING: All illegal access operations will be denied in a future release
      

      This illegal access should not be performed at all. I have not yet looked at the code to see how it can be avoided / removed.

       

      The likely cause of this message is the following code in SSLIOSession.doHandshake():

                          if (this.tlsDetails == null) {
                              final SSLSession sslSession = this.sslEngine.getSession();
                              final String applicationProtocol = ReflectionUtils.callGetter(this.sslEngine, "ApplicationProtocol", String.class);
                              this.tlsDetails = new TlsDetails(sslSession, applicationProtocol);           
                          }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            jnrouvignac Jean-Noel Rouvignac
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: