1
1
[role="xpack"]
2
2
[[tls-http]]
3
- ==== Encrypting HTTP Client communications
3
+ ==== Encrypting HTTP client communications
4
4
5
5
When {security-features} are enabled, you can optionally use TLS to ensure that
6
6
communication between HTTP clients and the cluster is encrypted.
7
7
8
8
NOTE: Enabling TLS on the HTTP layer is strongly recommended but is not required.
9
9
If 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.
12
12
13
13
. 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
+ --
14
38
15
39
. Enable TLS and specify the information required to access the node’s
16
- certificate.
40
+ certificate. For example:
17
41
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.
20
44
+
21
45
--
46
+ If the certificates are in PKCS#12 format:
47
+
22
48
[source, yaml]
23
49
--------------------------------------------------
24
50
xpack.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"
27
52
--------------------------------------------------
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
- --
35
53
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
+
40
56
[source, yaml]
41
57
--------------------------------------------------
42
58
xpack.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>
45
61
xpack.security.http.ssl.certificate_authorities: [ "/home/es/config/ca.crt" ] <3>
46
62
--------------------------------------------------
47
63
<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
52
68
must be a location within the {es} configuration directory.
53
69
--
54
70
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}.
59
73
+
60
74
--
75
+ If the certificates are in PKCS#12 format:
76
+
61
77
[source,shell]
62
78
-----------------------------------------------------------
63
79
bin/elasticsearch-keystore add xpack.security.http.ssl.keystore.secure_password
64
-
65
- bin/elasticsearch-keystore add xpack.security.http.ssl.truststore.secure_password
66
80
-----------------------------------------------------------
67
- --
68
81
69
- ** If the certificate is in PEM format, use the following commands:
70
- +
71
- --
82
+ If the certificates are in PEM format:
83
+
72
84
[source,shell]
73
85
-----------------------------------------------------------
74
86
bin/elasticsearch-keystore add xpack.security.http.ssl.secure_key_passphrase
75
87
-----------------------------------------------------------
76
88
--
77
89
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
+
78
94
. Restart {es}.
79
95
80
96
[NOTE]
0 commit comments