question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it support HTTPS protocol?

See original GitHub issue

Hi guys,

I tried to connect to my CH node through HTTP protocol and it was successful. Then I want to connect via HTTPS and change the port to 8443. But I encountered this error:

Caused by: com.clickhouse.client.ClickHouseException: Unexpected end of file from server, server ClickHouseNode(addr=http:xxx:8443, db=system)@1378242005
	at com.clickhouse.client.ClickHouseException.of(ClickHouseException.java:113) ~[clickhouse-client-0.3.2-patch5.jar:na]
	at com.clickhouse.client.http.ClickHouseHttpClient.lambda$execute$0(ClickHouseHttpClient.java:109) ~[clickhouse-http-client-0.3.2-patch5.jar:na]
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
	at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
Caused by: java.net.SocketException: Unexpected end of file from server
	at java.base/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:866) ~[na:na]
	at java.base/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:689) ~[na:na]
	at java.base/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:863) ~[na:na]
	at java.base/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:689) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1615) ~[na:na]
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520) ~[na:na]
	at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527) ~[na:na]
	at com.clickhouse.client.http.HttpUrlConnectionImpl.checkResponse(HttpUrlConnectionImpl.java:116) ~[clickhouse-http-client-0.3.2-patch5.jar:na]
	at com.clickhouse.client.http.HttpUrlConnectionImpl.post(HttpUrlConnectionImpl.java:201) ~[clickhouse-http-client-0.3.2-patch5.jar:na]
	at com.clickhouse.client.http.ClickHouseHttpClient.postRequest(ClickHouseHttpClient.java:88) ~[clickhouse-http-client-0.3.2-patch5.jar:na]
	at com.clickhouse.client.http.ClickHouseHttpClient.lambda$execute$0(ClickHouseHttpClient.java:107) ~[clickhouse-http-client-0.3.2-patch5.jar:na]
	... 4 common frames omitted

It seem that the library still use HTTP parser. Does this mean that currently this library does not support HTTPS connections? But I noticed that there is configuration about ssl in ClickHouseConfig class. Does anyone know about this? It would be very helpful! 😃

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
fsgdgsdfgsgdcommented, Mar 1, 2022

Oh I found it. I should use ClickHouseRequest.option() to set property. Very sorry! 😃

0reactions
fsgdgsdfgsgdcommented, Mar 1, 2022

Sorry I didn’t make it clear. Actually, I want to know how to set ssl through Java client, because I see your example is using JDBC driver.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is HTTPS? | Cloudflare
Technically speaking, HTTPS is not a separate protocol from HTTP. It is simply using TLS/SSL encryption over the HTTP protocol. HTTPS occurs based...
Read more >
HTTPS - Wikipedia
Hypertext Transfer Protocol Secure (HTTPS) is an extension of the Hypertext Transfer Protocol (HTTP). It is used for secure communication over a computer ......
Read more >
What is HTTPS? - SSL.com
HTTPS (Hypertext Transfer Protocol Secure) is a secure version of the HTTP protocol that uses the SSL/TLS protocol for encryption and authentication.
Read more >
Enabling HTTPS on your servers - web.dev
Enabling HTTPS on your servers is critical to securing your webpages. ... Server Configuration tool to set up your server for HTTPS support....
Read more >
What is SSL, TLS and HTTPS? - DigiCert
HTTPS (Hyper Text Transfer Protocol Secure) appears in the URL when a website is secured by an SSL certificate. The details of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found