jira-importer opened a new issue, #1248:
URL: https://github.com/apache/httpcomponents-core/issues/1248

   **[Johan 
Compagner](https://issues.apache.org/jira/secure/[email protected])**
 opened 
**[HTTPCORE-724](https://issues.apache.org/jira/browse/HTTPCORE-724?redirect=false)**
 and commented
   
   a basic example:
   
    
   
    
   
    
   
   ```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());
           };
       }
   ```
   
    
   
    
   
   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)
   
    
   
    
   
    
   
   
   ---
   
   **Affects:** 5.1.4
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to