From 344603e40f24324e784fcafabab42f27ef7cb9eb Mon Sep 17 00:00:00 2001 From: jaymode Date: Fri, 15 Sep 2017 08:56:34 -0600 Subject: [PATCH] update text in TLSLicenseBootstrapCheck Original commit: elastic/x-pack-elasticsearch@4ee6827566de2381ae338f54117f524b84f464b6 --- .../xpack/ssl/TLSLicenseBootstrapCheck.java | 20 ++----------------- .../ssl/TLSLicenseBootstrapCheckTests.java | 5 +++-- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ssl/TLSLicenseBootstrapCheck.java b/plugin/src/main/java/org/elasticsearch/xpack/ssl/TLSLicenseBootstrapCheck.java index 1b5109901db..c18da907f65 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ssl/TLSLicenseBootstrapCheck.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ssl/TLSLicenseBootstrapCheck.java @@ -5,29 +5,12 @@ */ package org.elasticsearch.xpack.ssl; -import org.elasticsearch.ElasticsearchException; import org.elasticsearch.bootstrap.BootstrapCheck; import org.elasticsearch.bootstrap.BootstrapContext; -import org.elasticsearch.common.inject.internal.Nullable; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.env.Environment; import org.elasticsearch.license.License; import org.elasticsearch.license.LicenseService; import org.elasticsearch.xpack.XPackSettings; -import java.io.IOException; -import java.io.UncheckedIOException; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.security.NoSuchProviderException; -import java.security.PrivateKey; -import java.security.PublicKey; -import java.security.SignatureException; -import java.security.cert.CertificateException; -import java.util.Arrays; -import java.util.Objects; -import java.util.stream.Stream; - /** * Bootstrap check to ensure that if we are starting up with a production license in the local clusterstate TLS is enabled */ @@ -38,7 +21,8 @@ public final class TLSLicenseBootstrapCheck implements BootstrapCheck { License license = LicenseService.getLicense(context.metaData); if (license != null && license.isProductionLicense()) { return BootstrapCheckResult.failure("Transport SSL must be enabled for setups with production licenses. Please set " + - "[xpack.security.transport.ssl.enabled] or disables security via [xpack.security.enabled]"); + "[xpack.security.transport.ssl.enabled] to [true] or disable security by setting [xpack.security.enabled] " + + "to [false]"); } } return BootstrapCheckResult.success(); diff --git a/plugin/src/test/java/org/elasticsearch/xpack/ssl/TLSLicenseBootstrapCheckTests.java b/plugin/src/test/java/org/elasticsearch/xpack/ssl/TLSLicenseBootstrapCheckTests.java index 7b4a3db51d1..048cfa9c01d 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/ssl/TLSLicenseBootstrapCheckTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/ssl/TLSLicenseBootstrapCheckTests.java @@ -34,8 +34,9 @@ public class TLSLicenseBootstrapCheckTests extends ESTestCase { } else { assertTrue(new TLSLicenseBootstrapCheck().check(new BootstrapContext( Settings.builder().put("xpack.security.transport.ssl.enabled", false).build(), build)).isFailure()); - assertEquals("Transport SSL must be enabled for setups with production licenses." + - " Please set [xpack.security.transport.ssl.enabled] or disables security via [xpack.security.enabled]", + assertEquals("Transport SSL must be enabled for setups with production licenses. Please set " + + "[xpack.security.transport.ssl.enabled] to [true] or disable security by setting " + + "[xpack.security.enabled] to [false]", new TLSLicenseBootstrapCheck().check(new BootstrapContext( Settings.builder().put("xpack.security.transport.ssl.enabled", false).build(), build)).getMessage()); }