You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Jean-Noel Rouvignac (Jira)" <ji...@apache.org> on 2021/02/01 12:50:00 UTC

[jira] [Commented] (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()

    [ https://issues.apache.org/jira/browse/HTTPCORE-664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17276295#comment-17276295 ] 

Jean-Noel Rouvignac commented on HTTPCORE-664:
----------------------------------------------

I agree with your comments about Java 1.7.
Thanks a lot for providing a workaround to remove this illegal access warning!

> WARNING: Illegal reflective access by org.apache.hc.core5.util.ReflectionUtils$1 (file:/mnt/blah.jar) to method sun.security.ssl.SSLEngineImpl.getApplicationProtocol()
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-664
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-664
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore
>    Affects Versions: 5.0.3
>         Environment: Java 11
>            Reporter: Jean-Noel Rouvignac
>            Priority: Major
>
> Using httpcore5 with Java 11, we noticed the code is reporting the following warning reported by the JVM:
> {noformat}
> 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
> {noformat}
> 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()}}|https://github.com/apache/httpcomponents-core/blob/master/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java#L390]:
> {code:java}
>                     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);           
>                     }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org