@@ -217,19 +217,46 @@ If the nodes running Sonar are behind an http proxy then the Kafka broker cannot
217217directly, but must be contacted through a Kafka proxy that accepts the data via an http REST call
218218and forwards them to the broker. The proxy in ` util/kafka-proxy ` can be used for this and Sonar
219219knows how to talk to it. In this case, configure the ` [kafka] ` section of Sonar's config with a
220- ` rest-endpoint ` instead of a ` broker-address ` and leave out the ` ca-file ` . Run the proxy behind a
221- web server, eg, for nginx I use this:
220+ ` rest-endpoint ` instead of a ` broker-address ` . The 8090 port is the default for the proxy.
221+
222+ On the backend, there are two possible configurations, one for a standard TLS certificate on a host
223+ with a well-known name, one one for use with self-signed certificates for other setups.
224+
225+ Note in the following that there are two .ini files, one for Sonar on the nodes and one for the
226+ Kafka proxy on the backend. Both of those have ` [kafka] ` and ` [http] ` sections. Do not confuse
227+ them.
228+
229+ ### Well-known host names, standard cert
230+
231+ A host such as ` naic-monitor.uio.no ` has a fully qualified, globally visible name, and a cert from a
232+ normal CA. In this case, Sonar on the cluster nodes is configured * without* a ` kafka.ca-file `
233+ property but * with* an HTTPS ` kafka.rest-endpoint ` . On the backend, a standard web server takes
234+ care of TLS and forwards traffic over plain HTTP to the kafka proxy that runs on the backend but is
235+ not externally visible. For example, for nginx I use this:
222236
223237```
224238 location /kprox {
225239 proxy_pass http://localhost:8090;
226240 }
227241```
228242
229- and set up the ` rest-endpoint ` to be ` https://my-kafka-host.uio.no/kprox ` . The 8090 port is the
230- default for the proxy. Then the ini file * for the proxy* is usually pretty simple, these values are
231- exactly those that were used in the Sonar config file when it was speaking directly to the Kafka
232- broker:
243+ For Sonar on the cluster nodes, I set up the corresponding ` rest-endpoint ` to be
244+ ` https://my-kafka-host.uio.no/kprox ` .
245+
246+ ### Private or no host name, self-signed cert
247+
248+ For test setups or hosts that have no names or at least not globally or organization-wide visible
249+ names, a self-signed certificate can be used for HTTPS. In this case we have two files, the server
250+ certificate (call it sonar-ca.crt) and the secret key (sonar-ca-key.pem). The certificate is not
251+ secret and is distributed to all the cluter nodes. For Sonar, ` kafka.ca-file ` is set to point to
252+ that file, along with a ` kafka.rest-endpoint ` using HTTPS (as above). On the proxy, the
253+ ` http.ca-file ` points to the server certificate and ` http.key-file ` points to the secret key. This
254+ is sufficient for Sonar and the proxy to be communicating over HTTPS.
255+
256+ ### Proxy-to-Kafka communication
257+
258+ Then the ini file for the proxy is usually pretty simple, these values are exactly those that were
259+ used in the Sonar config file when it was speaking directly to the Kafka broker:
233260
234261```
235262[kafka]
0 commit comments