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

Johan Compagner commented on HTTPCORE-724:
------------------------------------------

Ah i guess this line:

 

[httpcomponents-client/AsyncClientTlsAlpn.java at 5.1.x · 
apache/httpcomponents-client 
(github.com)|https://github.com/apache/httpcomponents-client/blob/5.1.x/httpclient5/src/test/java/org/apache/hc/client5/http/examples/AsyncClientTlsAlpn.java#L60]

 

means really "java 9 and newer" not "older" right?

 

1 problem is that if you compile still against java 8 but people run your stuff 
on java 17 (they can choose) then this is a bit of a problem

 

> org.apache.hc.core5.util.ReflectionUtils us using illegal reflective access
> ---------------------------------------------------------------------------
>
>                 Key: HTTPCORE-724
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-724
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>    Affects Versions: 5.1.4
>            Reporter: Johan Compagner
>            Priority: Major
>
> a basic example:
>  
>  
>  
> {code:java}
> public class Main {
>     public static void main(String[] args) throws IOException, 
> InterruptedException, ExecutionException, NoSuchAlgorithmException {
>         System.err.println(String.join(" ", 
> SSLContext.getDefault().getSupportedSSLParameters().getProtocols()));
>         try (CloseableHttpAsyncClient client = 
> HttpAsyncClients.createDefault()) {
>             client.start();
>             SimpleHttpRequest request1 = 
> SimpleRequestBuilder.get("https://www.google.com/";).build();
>             Future<SimpleHttpResponse> future = client.execute(request1, 
> null);
>             // and wait until response is received
>             SimpleHttpResponse response1 = future.get();
>             System.out.println(request1.getRequestUri() + "->" + 
> response1.getCode());
>         };
>     }
> {code}
>  
>  
> does not work under java 16 or higher
>  
> in java 16 you can get around it by using:
> --illegal-access=permit
> but in java 17 that is not allowed anymore, that is ignored.
> if you run it with java 15 you will get:
>  
> WARNING: Illegal reflective access by 
> org.apache.hc.core5.util.ReflectionUtils$1 
> ([file:/C:/workspace_master/HttpTest/lib/httpcore5-5.1.4.jar|file:///C:/workspace_master/HttpTest/lib/httpcore5-5.1.4.jar])
>  to method sun.security.ssl.SSLEngineImpl.getApplicationProtocol()
>  
> and after that line if i enabled wire logging everything goes different, (i 
> think java 16/17 then just try todo http1.1)
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to