diff --git a/plugin/core/src/main/java/org/elasticsearch/license/LicenseService.java b/plugin/core/src/main/java/org/elasticsearch/license/LicenseService.java index adbe0c6df10..d0d882b7bda 100644 --- a/plugin/core/src/main/java/org/elasticsearch/license/LicenseService.java +++ b/plugin/core/src/main/java/org/elasticsearch/license/LicenseService.java @@ -216,8 +216,8 @@ public class LicenseService extends AbstractLifecycleComponent implements Cluste && XPackSettings.TRANSPORT_SSL_ENABLED.get(settings) == false && "single-node".equals(DiscoveryModule.DISCOVERY_TYPE_SETTING.get(settings)) == false) { // security is on but TLS is not configured we gonna fail the entire request and throw an exception - throw new IllegalStateException("Can not upgrade to a production license unless TLS is configured or " + - "security is disabled"); + throw new IllegalStateException("Cannot install a [" + newLicense.operationMode() + + "] license unless TLS is configured or security is disabled"); // TODO we should really validate that all nodes have xpack installed and are consistently configured but this // should happen on a different level and not in this code } else { diff --git a/plugin/core/src/test/java/org/elasticsearch/license/LicensesAcknowledgementTests.java b/plugin/core/src/test/java/org/elasticsearch/license/LicensesAcknowledgementTests.java index eed19785b1b..211215da21c 100644 --- a/plugin/core/src/test/java/org/elasticsearch/license/LicensesAcknowledgementTests.java +++ b/plugin/core/src/test/java/org/elasticsearch/license/LicensesAcknowledgementTests.java @@ -48,7 +48,7 @@ public class LicensesAcknowledgementTests extends AbstractLicenseServiceTestCase // ensure acknowledgement message was part of the response IllegalStateException ise = expectThrows(IllegalStateException.class, () -> licenseService.registerLicense(putLicenseRequest, new AssertingLicensesUpdateResponse(false, LicensesStatus.VALID, true))); - assertEquals("Can not upgrade to a production license unless TLS is configured or security is disabled", ise.getMessage()); + assertEquals("Cannot install a [PLATINUM] license unless TLS is configured or security is disabled", ise.getMessage()); } public void testUpgradeToProductionWithoutTLSAndSecurityDisabled() throws Exception { diff --git a/plugin/security/src/test/java/org/elasticsearch/license/LicenseServiceWithSecurityTests.java b/plugin/security/src/test/java/org/elasticsearch/license/LicenseServiceWithSecurityTests.java index 230e29c6b80..42bfd2df1d5 100644 --- a/plugin/security/src/test/java/org/elasticsearch/license/LicenseServiceWithSecurityTests.java +++ b/plugin/security/src/test/java/org/elasticsearch/license/LicenseServiceWithSecurityTests.java @@ -11,7 +11,6 @@ import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.SecurityIntegTestCase; import org.elasticsearch.transport.Netty4Plugin; import org.elasticsearch.xpack.security.LocalStateSecurity; -import org.elasticsearch.xpack.security.Security; import java.util.Arrays; import java.util.Collection; @@ -39,7 +38,7 @@ public class LicenseServiceWithSecurityTests extends SecurityIntegTestCase { License license = licensingClient.prepareGetLicense().get().license(); License prodLicense = TestUtils.generateSignedLicense("platinum", TimeValue.timeValueHours(24)); IllegalStateException ise = expectThrows(IllegalStateException.class, () -> licensingClient.preparePutLicense(prodLicense).get()); - assertEquals("Can not upgrade to a production license unless TLS is configured or security is disabled", ise.getMessage()); + assertEquals("Cannot install a [PLATINUM] license unless TLS is configured or security is disabled", ise.getMessage()); assertThat(licensingClient.prepareGetLicense().get().license(), equalTo(license)); }