@@ -86,9 +86,12 @@ openssl req -newkey rsa:2048 -nodes \
8686openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial \
8787 -days 365 -out server.crt \
8888 -extfile <( printf " subjectAltName=DNS:localhost,IP:127.0.0.1" )
89+
90+ # Only for demo purpose we make key readable by all. On production should be readable only by owner, not even by group.^M
91+ chmod a+r server.key
8992```
9093
91- 2 . Create a ` config.d ` overlay enabling the HTTPS interface, e.g. ` zzz_ssl .xml` :
94+ 2 . Create a ` config.d ` overlay enabling the HTTPS interface, e.g. ` my_ssl .xml` :
9295
9396``` xml
9497<clickhouse >
@@ -112,12 +115,22 @@ openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial \
112115docker run -d --name clickhouse-ssl -p 8443:8443 \
113116 -v " $PWD /server.crt:/etc/clickhouse-server/certs/server.crt:ro" \
114117 -v " $PWD /server.key:/etc/clickhouse-server/certs/server.key:ro" \
115- -v " $PWD /zzz_ssl.xml:/etc/clickhouse-server/config.d/zzz_ssl.xml:ro" \
118+ -v " $PWD /my_ssl.xml:/etc/clickhouse-server/config.d/my_ssl.xml:ro" \
119+ -e CLICKHOUSE_PASSWORD=" secret" \
116120 clickhouse/clickhouse-server:latest
117121```
118122
1191234 . Run the example in standalone mode with
120124` -DchUrl="jdbc:clickhouse://localhost:8443/default" -DchRootCert="$PWD/ca.crt" ` .
121125
126+ ``` shell
127+ mvn exec:java -Dexec.mainClass=" com.clickhouse.examples.jdbc.SSLExamples" \
128+ -DchUrl=" jdbc:clickhouse:https://localhost:8443/default" \
129+ -DchUser=" default" \
130+ -DchPassword=" secret" \
131+ -DchRootCert=" $PWD /ca.crt"
132+ ```
133+
134+
122135The full description of the server-side TLS configuration is in the official documentation:
123136[ Configuring SSL-TLS] ( https://clickhouse.com/docs/en/guides/sre/configuring-ssl ) .
0 commit comments