Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[client-v2] addEndpoint(String) doesn't enable https protocol #1718

Closed
chernser opened this issue Jul 1, 2024 · 0 comments · Fixed by #1719
Closed

[client-v2] addEndpoint(String) doesn't enable https protocol #1718

chernser opened this issue Jul 1, 2024 · 0 comments · Fixed by #1719

Comments

@chernser
Copy link
Contributor

chernser commented Jul 1, 2024

Describe the bug

Steps to reproduce

  1. init client with .addEndpoint("https://some.host.com:8443")
  2. do any query

Expected behavior

No errors

Code example

    public static void main(String... agrs) {
        Client.Builder clientBuilder = new Client.Builder()
                .addEndpoint("https://some.host.com:8443")
                .setUsername("default")
                .setPassword("");

        Client client = clientBuilder.build();

        try {
            CommandResponse response = client.execute("SELECT 1").get(10, TimeUnit.SECONDS);

            System.out.println(response.getServerTime());

        } catch (Exception e) {
            e.printStackTrace();
        }

Error log

java.util.concurrent.ExecutionException: com.clickhouse.client.api.ClientException: Query request failed
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096)
	at com.clickhouse.testing.SimpleVerification.main(SimpleVerification.java:23)
Caused by: com.clickhouse.client.api.ClientException: Query request failed
	at com.clickhouse.client.api.query.QueryResponse.makeComplete(QueryResponse.java:72)
	at com.clickhouse.client.api.query.QueryResponse.ensureDone(QueryResponse.java:62)
	at com.clickhouse.client.api.Client.lambda$query$4(Client.java:727)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.util.concurrent.ExecutionException: com.clickhouse.client.ClickHouseException: HTTP request failed: https protocol is not supported
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096)
	at com.clickhouse.client.api.query.QueryResponse.makeComplete(QueryResponse.java:68)
	... 6 more
Caused by: com.clickhouse.client.ClickHouseException: HTTP request failed: https protocol is not supported
	at com.clickhouse.client.ClickHouseException.of(ClickHouseException.java:149)
	at com.clickhouse.client.AbstractClient.lambda$execute$0(AbstractClient.java:275)
	... 4 more
Caused by: java.net.ConnectException: HTTP request failed: https protocol is not supported
	at com.clickhouse.client.http.ApacheHttpConnectionImpl.post(ApacheHttpConnectionImpl.java:258)
	at com.clickhouse.client.http.ClickHouseHttpClient.send(ClickHouseHttpClient.java:194)
	at com.clickhouse.client.AbstractClient.sendAsync(AbstractClient.java:161)
	at com.clickhouse.client.AbstractClient.lambda$execute$0(AbstractClient.java:273)
	... 4 more

Configuration

Environment

  • Client version: 0.6.2
  • Language version: 17
  • OS: Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant