Hi,
I'm, configuring Elasticsearch with TLS but facing error when I restart the Elasticsearch server
This is my Elasticsearch.yml configuration for security
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.client_authentication: required
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12
This is the error I'm getting
[2022-03-15T12:32:23,041][ERROR][o.e.b.Bootstrap ] [es-test-node-1] Exception
java.lang.IllegalArgumentException: a key must be provided to run as a server. the key should be configured using the [xpack.security.http.ssl.key] or [xpack.security.http.ssl.keystore.path] setting
at org.elasticsearch.xpack.security.transport.netty4.SecurityNetty4HttpServerTransport.<init>(SecurityNetty4HttpServerTransport.java:61) ~[?:?]
at org.elasticsearch.xpack.security.Security.lambda$getHttpTransports$27(Security.java:1489) ~[?:?]
at org.elasticsearch.node.Node.newHttpTransport(Node.java:1589) ~[elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.node.Node.<init>(Node.java:818) ~[elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.node.Node.<init>(Node.java:309) ~[elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:234) ~[elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:234) ~[elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434) [elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:166) [elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:157) [elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77) [elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112) [elasticsearch-cli-7.17.0.jar:7.17.0]
at org.elasticsearch.cli.Command.main(Command.java:77) [elasticsearch-cli-7.17.0.jar:7.17.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:122) [elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80) [elasticsearch-7.17.0.jar:7.17.0]
[2022-03-15T12:32:23,048][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [es-test-node-1] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: a key must be provided to run as a server. the key should be configured using the [xpack.security.http.ssl.key] or [xpack.security.http.ssl.keystore.path] setting
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:157) ~[elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77) ~[elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112) ~[elasticsearch-cli-7.17.0.jar:7.17.0]
at org.elasticsearch.cli.Command.main(Command.java:77) ~[elasticsearch-cli-7.17.0.jar:7.17.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:122) ~[elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80) ~[elasticsearch-7.17.0.jar:7.17.0]
Caused by: java.lang.IllegalArgumentException: a key must be provided to run as a server. the key should be configured using the [xpack.security.http.ssl.key] or [xpack.security.http.ssl.keystore.path] setting
at org.elasticsearch.xpack.security.transport.netty4.SecurityNetty4HttpServerTransport.<init>(SecurityNetty4HttpServerTransport.java:61) ~[?:?]
at org.elasticsearch.xpack.security.Security.lambda$getHttpTransports$27(Security.java:1489) ~[?:?]
at org.elasticsearch.node.Node.newHttpTransport(Node.java:1589) ~[elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.node.Node.<init>(Node.java:818) ~[elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.node.Node.<init>(Node.java:309) ~[elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:234) ~[elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:234) ~[elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434) ~[elasticsearch-7.17.0.jar:7.17.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:166) ~[elasticsearch-7.17.0.jar:7.17.0]
Please help me in resolving this