11[role="xpack"]
22[[tls-http]]
3- ==== Encrypting HTTP Client communications
3+ ==== Encrypting HTTP client communications
44
55When {security-features} are enabled, you can optionally use TLS to ensure that
66communication between HTTP clients and the cluster is encrypted.
77
88NOTE: Enabling TLS on the HTTP layer is strongly recommended but is not required.
99If you enable TLS on the HTTP layer in {es}, then you might need to make
10- configuration changes in other parts of the Elastic Stack and in any {es}
11- clients that you use.
10+ configuration changes in other parts of the {stack} and in any {es} clients that
11+ you use.
1212
1313. If you have not done so already, <<node-certificates,generate node certificates>>.
14+ +
15+ --
16+ In particular, you need the files that are generated by the following command:
17+
18+ [source,shell]
19+ ----------------------------------------------------------
20+ bin/elasticsearch-certutil http
21+ ----------------------------------------------------------
22+
23+ This command generates a zip file that contains certificates and keys for use in
24+ {es} and {kib}. Each folder contains a readme that explains how to use the files.
25+ --
26+
27+ . Verify that you've copied the output files to the appropriate locations, as
28+ specified in the readme files.
29+ +
30+ --
31+ For example, copy the `http.p12` file from the `elasticsearch` folder into a
32+ directory within the {es} configuration directory on each node. If you chose to
33+ generate one certificate per node, copy the appropriate `http.p12` file to each
34+ node. If you want to use {kib} to access this cluster, copy the
35+ `elasticsearch-ca.pem` file from the `kibana` folder into the {kib}
36+ configuration directory.
37+ --
1438
1539. Enable TLS and specify the information required to access the node’s
16- certificate.
40+ certificate. For example:
1741
18- ** If the certificate is in PKCS#12 format, add the following information to the
19- `elasticsearch.yml` file on each node:
42+ .. Update the `elasticsearch.yml` file on each node with the location of the
43+ certificates.
2044+
2145--
46+ If the certificates are in PKCS#12 format:
47+
2248[source, yaml]
2349--------------------------------------------------
2450xpack.security.http.ssl.enabled: true
25- xpack.security.http.ssl.keystore.path: certs/elastic-certificates.p12 <1>
26- xpack.security.http.ssl.truststore.path: certs/elastic-certificates.p12 <2>
51+ xpack.security.http.ssl.keystore.path: "http.p12"
2752--------------------------------------------------
28- <1> If you created a separate certificate for each node, then you might need to
29- customize this path on each node. If the filename matches the node name, you can
30- use the `certs/${node.name}.p12` format, for example.
31- <2> The `elasticsearch-certutil` output includes the CA certificate inside the
32- PKCS#12 keystore, therefore the keystore can also be used as the truststore.
33- This name should match the `keystore.path` value.
34- --
3553
36- ** If the certificate is in PEM format, add the following information to the
37- `elasticsearch.yml` file on each node:
38- +
39- --
54+ If you have certificates in PEM format:
55+
4056[source, yaml]
4157--------------------------------------------------
4258xpack.security.http.ssl.enabled: true
43- xpack.security.http.ssl.key: /home/es/config/node01 .key <1>
44- xpack.security.http.ssl.certificate: /home/es/config/node01 .crt <2>
59+ xpack.security.http.ssl.key: /home/es/config/node1_http .key <1>
60+ xpack.security.http.ssl.certificate: /home/es/config/node1_http .crt <2>
4561xpack.security.http.ssl.certificate_authorities: [ "/home/es/config/ca.crt" ] <3>
4662--------------------------------------------------
4763<1> The full path to the node key file. This must be a location within the
@@ -52,29 +68,29 @@ xpack.security.http.ssl.certificate_authorities: [ "/home/es/config/ca.crt" ] <3
5268 must be a location within the {es} configuration directory.
5369--
5470
55- . If you secured the node's certificate with a password, add the password to
56- your {es} keystore:
57-
58- ** If the signed certificate is in PKCS#12 format, use the following commands:
71+ .. If you secured the keystore or the private key with a password, add that password to a secure
72+ setting in {es}.
5973+
6074--
75+ If the certificates are in PKCS#12 format:
76+
6177[source,shell]
6278-----------------------------------------------------------
6379bin/elasticsearch-keystore add xpack.security.http.ssl.keystore.secure_password
64-
65- bin/elasticsearch-keystore add xpack.security.http.ssl.truststore.secure_password
6680-----------------------------------------------------------
67- --
6881
69- ** If the certificate is in PEM format, use the following commands:
70- +
71- --
82+ If the certificates are in PEM format:
83+
7284[source,shell]
7385-----------------------------------------------------------
7486bin/elasticsearch-keystore add xpack.security.http.ssl.secure_key_passphrase
7587-----------------------------------------------------------
7688--
7789
90+ . Optional: If you want to use {kib}, follow the instructions in the readme
91+ provided by the `elasticsearch-certutil http` command or see
92+ {kibana-ref}/configuring-tls.html[Encrypting communications in {kib}].
93+
7894. Restart {es}.
7995
8096[NOTE]
0 commit comments