You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Johan Compagner (Jira)" <ji...@apache.org> on 2022/08/23 16:53:00 UTC
[jira] [Commented] (HTTPCORE-724) org.apache.hc.core5.util.ReflectionUtils us using illegal reflective access
[ https://issues.apache.org/jira/browse/HTTPCORE-724?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17583754#comment-17583754 ]
Johan Compagner commented on HTTPCORE-724:
------------------------------------------
ok this seems to work for java 17:
--add-opens java.base/sun.security.ssl=ALL-UNNAMED
but i think that should be avoided right?
> 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org