diff options
| author | Alex Rudyy <orudyy@apache.org> | 2015-02-05 22:53:16 +0000 |
|---|---|---|
| committer | Alex Rudyy <orudyy@apache.org> | 2015-02-05 22:53:16 +0000 |
| commit | 0f1feb11d7cbbe40de10a680eb22b28918608615 (patch) | |
| tree | c26efb56e1cfcead60de40531c922b5e186ef2cb /qpid/java/broker-core | |
| parent | d3f445a199c0ed050bd4fa4bc00f331111a7a64d (diff) | |
| download | qpid-python-0f1feb11d7cbbe40de10a680eb22b28918608615.tar.gz | |
QPID-6364: Add a secure attribute 'storeUrl' into Keystore for specifying store content location and make attribute 'path' derived. Rename Trsuststore attribute 'path' into 'storeUrl' for consistency.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1657708 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-core')
7 files changed, 110 insertions, 42 deletions
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileKeyStore.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileKeyStore.java index 899e98fa22..775571574f 100644 --- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileKeyStore.java +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileKeyStore.java @@ -22,6 +22,7 @@ package org.apache.qpid.server.security; import javax.net.ssl.KeyManagerFactory; +import org.apache.qpid.server.model.DerivedAttribute; import org.apache.qpid.server.model.KeyStore; import org.apache.qpid.server.model.ManagedAttribute; import org.apache.qpid.server.model.ManagedContextDefault; @@ -35,7 +36,8 @@ public interface FileKeyStore<X extends FileKeyStore<X>> extends KeyStore<X> String CERTIFICATE_ALIAS = "certificateAlias"; String KEY_STORE_TYPE = "keyStoreType"; String PASSWORD = "password"; - String PATH = "path"; + String STORE_URL = "storeUrl"; + @ManagedContextDefault(name = "keyStoreFile.keyStoreType") RuntimeDefault<String> DEFAULT_KEYSTORE_TYPE = new RuntimeDefault<String>() @@ -60,7 +62,10 @@ public interface FileKeyStore<X extends FileKeyStore<X>> extends KeyStore<X> @ManagedAttribute(defaultValue = "${this:path}") String getDescription(); - @ManagedAttribute( mandatory = true) + @ManagedAttribute( mandatory = true, secure = true) + String getStoreUrl(); + + @DerivedAttribute String getPath(); @ManagedAttribute diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileKeyStoreImpl.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileKeyStoreImpl.java index 31a4b473ed..7bed1bcd7d 100644 --- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileKeyStoreImpl.java +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileKeyStoreImpl.java @@ -68,7 +68,8 @@ public class FileKeyStoreImpl extends AbstractConfiguredObject<FileKeyStoreImpl> private String _certificateAlias; @ManagedAttributeField private String _keyManagerFactoryAlgorithm; - @ManagedAttributeField + @ManagedAttributeField(afterSet = "postSetStoreUrl") + private String _storeUrl; private String _path; @ManagedAttributeField private String _password; @@ -162,7 +163,7 @@ public class FileKeyStoreImpl extends AbstractConfiguredObject<FileKeyStoreImpl> java.security.KeyStore keyStore; try { - URL url = getUrlFromString(fileKeyStore.getPath()); + URL url = getUrlFromString(fileKeyStore.getStoreUrl()); String password = fileKeyStore.getPassword(); String keyStoreType = fileKeyStore.getKeyStoreType(); keyStore = SSLUtil.getInitializedKeyStore(url, password, keyStoreType); @@ -173,11 +174,11 @@ public class FileKeyStoreImpl extends AbstractConfiguredObject<FileKeyStoreImpl> final String message; if (e instanceof IOException && e.getCause() != null && e.getCause() instanceof UnrecoverableKeyException) { - message = "Check key store password. Cannot instantiate key store from '" + fileKeyStore.getPath() + "'."; + message = "Check key store password. Cannot instantiate key store from '" + fileKeyStore.getStoreUrl() + "'."; } else { - message = "Cannot instantiate key store from '" + fileKeyStore.getPath() + "'."; + message = "Cannot instantiate key store from '" + fileKeyStore.getStoreUrl() + "'."; } throw new IllegalConfigurationException(message, e); @@ -198,7 +199,7 @@ public class FileKeyStoreImpl extends AbstractConfiguredObject<FileKeyStoreImpl> if (cert == null) { throw new IllegalConfigurationException("Cannot find a certificate with alias '" + fileKeyStore.getCertificateAlias() - + "' in key store : " + fileKeyStore.getPath()); + + "' in key store : " + fileKeyStore.getStoreUrl()); } } @@ -219,6 +220,12 @@ public class FileKeyStoreImpl extends AbstractConfiguredObject<FileKeyStoreImpl> } @Override + public String getStoreUrl() + { + return _storeUrl; + } + + @Override public String getPath() { return _path; @@ -258,7 +265,7 @@ public class FileKeyStoreImpl extends AbstractConfiguredObject<FileKeyStoreImpl> try { - URL url = getUrlFromString(_path); + URL url = getUrlFromString(_storeUrl); if (_certificateAlias != null) { return new KeyManager[] { @@ -301,4 +308,18 @@ public class FileKeyStoreImpl extends AbstractConfiguredObject<FileKeyStoreImpl> } return url; } + + @SuppressWarnings(value = "unused") + private void postSetStoreUrl() + { + try + { + new URL(_storeUrl); + _path = null; + } + catch (MalformedURLException e) + { + _path = _storeUrl; + } + } } diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStore.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStore.java index 86d7d5e4b8..f876831724 100644 --- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStore.java +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStore.java @@ -22,6 +22,7 @@ package org.apache.qpid.server.security; import javax.net.ssl.KeyManagerFactory; +import org.apache.qpid.server.model.DerivedAttribute; import org.apache.qpid.server.model.ManagedAttribute; import org.apache.qpid.server.model.ManagedContextDefault; import org.apache.qpid.server.model.ManagedObject; @@ -35,7 +36,7 @@ public interface FileTrustStore<X extends FileTrustStore<X>> extends TrustStore< String PEERS_ONLY = "peersOnly"; String TRUST_STORE_TYPE = "trustStoreType"; String PASSWORD = "password"; - String PATH = "path"; + String STORE_URL = "storeUrl"; @ManagedContextDefault(name = "trustStoreFile.trustStoreType") RuntimeDefault<String> DEFAULT_TRUSTSTORE_TYPE = new RuntimeDefault<String>() @@ -58,10 +59,13 @@ public interface FileTrustStore<X extends FileTrustStore<X>> extends TrustStore< }; - @ManagedAttribute(defaultValue = "${this:path}") + @ManagedAttribute(defaultValue = "${this:storeUrl}") String getDescription(); @ManagedAttribute( mandatory = true ) + String getStoreUrl(); + + @DerivedAttribute String getPath(); @ManagedAttribute( defaultValue = "${trustStoreFile.trustManagerFactoryAlgorithm}") diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java index 66ae6fdb35..78f9a5184b 100644 --- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java @@ -64,7 +64,8 @@ public class FileTrustStoreImpl extends AbstractConfiguredObject<FileTrustStoreI private String _trustStoreType; @ManagedAttributeField private String _trustManagerFactoryAlgorithm; - @ManagedAttributeField + @ManagedAttributeField(afterSet = "postSetStoreUrl") + private String _storeUrl; private String _path; @ManagedAttributeField private boolean _peersOnly; @@ -193,7 +194,7 @@ public class FileTrustStoreImpl extends AbstractConfiguredObject<FileTrustStoreI { try { - URL trustStoreUrl = getUrlFromString(trustStore.getPath()); + URL trustStoreUrl = getUrlFromString(trustStore.getStoreUrl()); SSLUtil.getInitializedKeyStore(trustStoreUrl, trustStore.getPassword(), trustStore.getTrustStoreType()); } catch (Exception e) @@ -201,11 +202,11 @@ public class FileTrustStoreImpl extends AbstractConfiguredObject<FileTrustStoreI final String message; if (e instanceof IOException && e.getCause() != null && e.getCause() instanceof UnrecoverableKeyException) { - message = "Check trust store password. Cannot instantiate trust store from '" + trustStore.getPath() + "'."; + message = "Check trust store password. Cannot instantiate trust store from '" + trustStore.getStoreUrl() + "'."; } else { - message = "Cannot instantiate trust store from '" + trustStore.getPath() + "'."; + message = "Cannot instantiate trust store from '" + trustStore.getStoreUrl() + "'."; } throw new IllegalConfigurationException(message, e); @@ -222,6 +223,12 @@ public class FileTrustStoreImpl extends AbstractConfiguredObject<FileTrustStoreI } @Override + public String getStoreUrl() + { + return _storeUrl; + } + + @Override public String getPath() { return _path; @@ -263,7 +270,7 @@ public class FileTrustStoreImpl extends AbstractConfiguredObject<FileTrustStoreI try { - URL trustStoreUrl = getUrlFromString(_path); + URL trustStoreUrl = getUrlFromString(_storeUrl); KeyStore ts = SSLUtil.getInitializedKeyStore(trustStoreUrl, trustStorePassword, trustStoreType); final TrustManagerFactory tmf = TrustManagerFactory @@ -328,4 +335,17 @@ public class FileTrustStoreImpl extends AbstractConfiguredObject<FileTrustStoreI return url; } + @SuppressWarnings(value = "unused") + private void postSetStoreUrl() + { + try + { + new URL(_storeUrl); + _path = null; + } + catch (MalformedURLException e) + { + _path = _storeUrl; + } + } } diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecoverer.java index a2d8d21d58..08612825de 100644 --- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecoverer.java +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecoverer.java @@ -245,10 +245,28 @@ public class BrokerStoreUpgraderAndRecoverer { record = upgradeRootRecord(record); } + else if("KeyStore".equals(record.getType())) + { + record = upgradeKeyStore(record); + } + else if("TrustStore".equals(record.getType())) + { + record = upgradeKeyStore(record); + } getNextUpgrader().configuredObject(record); } + private ConfiguredObjectRecord upgradeKeyStore(ConfiguredObjectRecord record) + { + Map<String, Object> attributes = new HashMap<>(record.getAttributes()); + Object path = attributes.remove("path"); + attributes.put("storeUrl", path); + record = new ConfiguredObjectRecordImpl(record.getId(), record.getType(), attributes, record.getParents()); + getUpdateMap().put(record.getId(), record); + return record; + } + private boolean isAmqpPort(final Map<String, Object> attributes) { Object type = attributes.get(ConfiguredObject.TYPE); diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/FileKeyStoreTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/FileKeyStoreTest.java index 0e45582d7c..0a2e122d16 100644 --- a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/FileKeyStoreTest.java +++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/FileKeyStoreTest.java @@ -69,7 +69,7 @@ public class FileKeyStoreTest extends QpidTestCase { Map<String,Object> attributes = new HashMap<>(); attributes.put(FileKeyStore.NAME, "myFileKeyStore"); - attributes.put(FileKeyStore.PATH, TestSSLConstants.BROKER_KEYSTORE); + attributes.put(FileKeyStore.STORE_URL, TestSSLConstants.BROKER_KEYSTORE); attributes.put(FileKeyStore.PASSWORD, TestSSLConstants.BROKER_KEYSTORE_PASSWORD); FileKeyStoreImpl fileKeyStore = (FileKeyStoreImpl) _factory.create(KeyStore.class, attributes, _broker); @@ -84,7 +84,7 @@ public class FileKeyStoreTest extends QpidTestCase { Map<String,Object> attributes = new HashMap<>(); attributes.put(FileKeyStore.NAME, "myFileKeyStore"); - attributes.put(FileKeyStore.PATH, TestSSLConstants.BROKER_KEYSTORE); + attributes.put(FileKeyStore.STORE_URL, TestSSLConstants.BROKER_KEYSTORE); attributes.put(FileKeyStore.PASSWORD, TestSSLConstants.BROKER_KEYSTORE_PASSWORD); attributes.put(FileKeyStore.CERTIFICATE_ALIAS, TestSSLConstants.BROKER_KEYSTORE_ALIAS); @@ -100,7 +100,7 @@ public class FileKeyStoreTest extends QpidTestCase { Map<String,Object> attributes = new HashMap<>(); attributes.put(FileKeyStore.NAME, "myFileKeyStore"); - attributes.put(FileKeyStore.PATH, TestSSLConstants.BROKER_KEYSTORE); + attributes.put(FileKeyStore.STORE_URL, TestSSLConstants.BROKER_KEYSTORE); attributes.put(FileKeyStore.PASSWORD, "wrong"); try @@ -119,7 +119,7 @@ public class FileKeyStoreTest extends QpidTestCase { Map<String,Object> attributes = new HashMap<>(); attributes.put(FileKeyStore.NAME, "myFileKeyStore"); - attributes.put(FileKeyStore.PATH, TestSSLConstants.KEYSTORE); + attributes.put(FileKeyStore.STORE_URL, TestSSLConstants.KEYSTORE); attributes.put(FileKeyStore.PASSWORD, TestSSLConstants.KEYSTORE_PASSWORD); attributes.put(FileKeyStore.CERTIFICATE_ALIAS, "notknown"); @@ -141,7 +141,7 @@ public class FileKeyStoreTest extends QpidTestCase Map<String,Object> attributes = new HashMap<>(); attributes.put(FileKeyStore.NAME, "myFileKeyStore"); - attributes.put(FileKeyStore.PATH, trustStoreAsDataUrl); + attributes.put(FileKeyStore.STORE_URL, trustStoreAsDataUrl); attributes.put(FileKeyStore.PASSWORD, TestSSLConstants.BROKER_KEYSTORE_PASSWORD); FileKeyStoreImpl fileKeyStore = (FileKeyStoreImpl) _factory.create(KeyStore.class, attributes, _broker); @@ -158,7 +158,7 @@ public class FileKeyStoreTest extends QpidTestCase Map<String,Object> attributes = new HashMap<>(); attributes.put(FileKeyStore.NAME, "myFileKeyStore"); - attributes.put(FileKeyStore.PATH, trustStoreAsDataUrl); + attributes.put(FileKeyStore.STORE_URL, trustStoreAsDataUrl); attributes.put(FileKeyStore.PASSWORD, TestSSLConstants.BROKER_KEYSTORE_PASSWORD); attributes.put(FileKeyStore.CERTIFICATE_ALIAS, TestSSLConstants.BROKER_KEYSTORE_ALIAS); @@ -177,7 +177,7 @@ public class FileKeyStoreTest extends QpidTestCase Map<String,Object> attributes = new HashMap<>(); attributes.put(FileKeyStore.NAME, "myFileKeyStore"); attributes.put(FileKeyStore.PASSWORD, "wrong"); - attributes.put(FileKeyStore.PATH, keyStoreAsDataUrl); + attributes.put(FileKeyStore.STORE_URL, keyStoreAsDataUrl); try { @@ -198,7 +198,7 @@ public class FileKeyStoreTest extends QpidTestCase Map<String,Object> attributes = new HashMap<>(); attributes.put(FileKeyStore.NAME, "myFileKeyStore"); attributes.put(FileKeyStore.PASSWORD, TestSSLConstants.BROKER_KEYSTORE_PASSWORD); - attributes.put(FileKeyStore.PATH, keyStoreAsDataUrl); + attributes.put(FileKeyStore.STORE_URL, keyStoreAsDataUrl); try { @@ -220,7 +220,7 @@ public class FileKeyStoreTest extends QpidTestCase Map<String,Object> attributes = new HashMap<>(); attributes.put(FileKeyStore.NAME, "myFileKeyStore"); attributes.put(FileKeyStore.PASSWORD, TestSSLConstants.BROKER_KEYSTORE_PASSWORD); - attributes.put(FileKeyStore.PATH, keyStoreAsDataUrl); + attributes.put(FileKeyStore.STORE_URL, keyStoreAsDataUrl); attributes.put(FileKeyStore.CERTIFICATE_ALIAS, "notknown"); try @@ -242,7 +242,7 @@ public class FileKeyStoreTest extends QpidTestCase Map<String,Object> attributes = new HashMap<>(); attributes.put(FileKeyStore.NAME, "myFileKeyStore"); - attributes.put(FileKeyStore.PATH, TestSSLConstants.BROKER_KEYSTORE); + attributes.put(FileKeyStore.STORE_URL, TestSSLConstants.BROKER_KEYSTORE); attributes.put(FileKeyStore.PASSWORD, TestSSLConstants.BROKER_KEYSTORE_PASSWORD); FileKeyStoreImpl fileKeyStore = (FileKeyStoreImpl) _factory.create(KeyStore.class, attributes, _broker); @@ -283,7 +283,7 @@ public class FileKeyStoreTest extends QpidTestCase Map<String,Object> attributes = new HashMap<>(); attributes.put(FileKeyStore.NAME, "myFileKeyStore"); - attributes.put(FileKeyStore.PATH, TestSSLConstants.BROKER_KEYSTORE); + attributes.put(FileKeyStore.STORE_URL, TestSSLConstants.BROKER_KEYSTORE); attributes.put(FileKeyStore.PASSWORD, TestSSLConstants.BROKER_KEYSTORE_PASSWORD); FileKeyStoreImpl fileKeyStore = (FileKeyStoreImpl) _factory.create(KeyStore.class, attributes, _broker); @@ -299,7 +299,7 @@ public class FileKeyStoreTest extends QpidTestCase Map<String,Object> attributes = new HashMap<>(); attributes.put(FileKeyStore.NAME, "myFileKeyStore"); - attributes.put(FileKeyStore.PATH, TestSSLConstants.BROKER_KEYSTORE); + attributes.put(FileKeyStore.STORE_URL, TestSSLConstants.BROKER_KEYSTORE); attributes.put(FileKeyStore.PASSWORD, TestSSLConstants.BROKER_KEYSTORE_PASSWORD); FileKeyStoreImpl fileKeyStore = (FileKeyStoreImpl) _factory.create(KeyStore.class, attributes, _broker); diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/FileTrustStoreTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/FileTrustStoreTest.java index d965549cdd..72c8926f85 100644 --- a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/FileTrustStoreTest.java +++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/FileTrustStoreTest.java @@ -73,7 +73,7 @@ public class FileTrustStoreTest extends QpidTestCase { Map<String,Object> attributes = new HashMap<>(); attributes.put(FileTrustStore.NAME, "myFileTrustStore"); - attributes.put(FileTrustStore.PATH, TestSSLConstants.TRUSTSTORE); + attributes.put(FileTrustStore.STORE_URL, TestSSLConstants.TRUSTSTORE); attributes.put(FileTrustStore.PASSWORD, TestSSLConstants.TRUSTSTORE_PASSWORD); FileTrustStoreImpl fileTrustStore = @@ -89,7 +89,7 @@ public class FileTrustStoreTest extends QpidTestCase { Map<String,Object> attributes = new HashMap<>(); attributes.put(FileTrustStore.NAME, "myFileTrustStore"); - attributes.put(FileTrustStore.PATH, TestSSLConstants.TRUSTSTORE); + attributes.put(FileTrustStore.STORE_URL, TestSSLConstants.TRUSTSTORE); attributes.put(FileTrustStore.PASSWORD, "wrong"); try @@ -108,7 +108,7 @@ public class FileTrustStoreTest extends QpidTestCase { Map<String,Object> attributes = new HashMap<>(); attributes.put(FileTrustStore.NAME, "myFileTrustStore"); - attributes.put(FileTrustStore.PATH, TestSSLConstants.BROKER_PEERSTORE); + attributes.put(FileTrustStore.STORE_URL, TestSSLConstants.BROKER_PEERSTORE); attributes.put(FileTrustStore.PASSWORD, TestSSLConstants.BROKER_PEERSTORE_PASSWORD); attributes.put(FileTrustStore.PEERS_ONLY, true); @@ -129,7 +129,7 @@ public class FileTrustStoreTest extends QpidTestCase Map<String,Object> attributes = new HashMap<>(); attributes.put(FileTrustStore.NAME, "myFileTrustStore"); - attributes.put(FileTrustStore.PATH, trustStoreAsDataUrl); + attributes.put(FileTrustStore.STORE_URL, trustStoreAsDataUrl); attributes.put(FileTrustStore.PASSWORD, TestSSLConstants.TRUSTSTORE_PASSWORD); FileTrustStoreImpl fileTrustStore = @@ -148,7 +148,7 @@ public class FileTrustStoreTest extends QpidTestCase Map<String,Object> attributes = new HashMap<>(); attributes.put(FileTrustStore.NAME, "myFileTrustStore"); attributes.put(FileTrustStore.PASSWORD, "wrong"); - attributes.put(FileTrustStore.PATH, trustStoreAsDataUrl); + attributes.put(FileTrustStore.STORE_URL, trustStoreAsDataUrl); try { @@ -169,7 +169,7 @@ public class FileTrustStoreTest extends QpidTestCase Map<String,Object> attributes = new HashMap<>(); attributes.put(FileTrustStore.NAME, "myFileTrustStore"); attributes.put(FileTrustStore.PASSWORD, TestSSLConstants.TRUSTSTORE_PASSWORD); - attributes.put(FileTrustStore.PATH, trustStoreAsDataUrl); + attributes.put(FileTrustStore.STORE_URL, trustStoreAsDataUrl); try { @@ -191,18 +191,18 @@ public class FileTrustStoreTest extends QpidTestCase Map<String,Object> attributes = new HashMap<>(); attributes.put(FileTrustStore.NAME, "myFileTrustStore"); - attributes.put(FileTrustStore.PATH, TestSSLConstants.TRUSTSTORE); + attributes.put(FileTrustStore.STORE_URL, TestSSLConstants.TRUSTSTORE); attributes.put(FileTrustStore.PASSWORD, TestSSLConstants.TRUSTSTORE_PASSWORD); FileTrustStoreImpl fileTrustStore = (FileTrustStoreImpl) _factory.create(TrustStore.class, attributes, _broker); - assertEquals("Unexpected path value before change", TestSSLConstants.TRUSTSTORE, fileTrustStore.getPath()); + assertEquals("Unexpected path value before change", TestSSLConstants.TRUSTSTORE, fileTrustStore.getStoreUrl()); try { Map<String,Object> unacceptableAttributes = new HashMap<>(); - unacceptableAttributes.put(FileTrustStore.PATH, "/not/a/truststore"); + unacceptableAttributes.put(FileTrustStore.STORE_URL, "/not/a/truststore"); fileTrustStore.setAttributes(unacceptableAttributes); fail("Exception not thrown"); @@ -213,17 +213,17 @@ public class FileTrustStoreTest extends QpidTestCase assertTrue("Exception text not as unexpected:" + message, message.contains("Cannot instantiate trust store")); } - assertEquals("Unexpected path value after failed change", TestSSLConstants.TRUSTSTORE, fileTrustStore.getPath()); + assertEquals("Unexpected path value after failed change", TestSSLConstants.TRUSTSTORE, fileTrustStore.getStoreUrl()); Map<String,Object> changedAttributes = new HashMap<>(); - changedAttributes.put(FileTrustStore.PATH, TestSSLConstants.BROKER_TRUSTSTORE); + changedAttributes.put(FileTrustStore.STORE_URL, TestSSLConstants.BROKER_TRUSTSTORE); changedAttributes.put(FileTrustStore.PASSWORD, TestSSLConstants.BROKER_TRUSTSTORE_PASSWORD); fileTrustStore.setAttributes(changedAttributes); assertEquals("Unexpected path value after change that is expected to be successful", TestSSLConstants.BROKER_TRUSTSTORE, - fileTrustStore.getPath()); + fileTrustStore.getStoreUrl()); } public void testDeleteTrustStore_Success() throws Exception @@ -233,7 +233,7 @@ public class FileTrustStoreTest extends QpidTestCase Map<String,Object> attributes = new HashMap<>(); attributes.put(FileTrustStore.NAME, "myFileTrustStore"); - attributes.put(FileTrustStore.PATH, TestSSLConstants.TRUSTSTORE); + attributes.put(FileTrustStore.STORE_URL, TestSSLConstants.TRUSTSTORE); attributes.put(FileTrustStore.PASSWORD, TestSSLConstants.TRUSTSTORE_PASSWORD); FileTrustStoreImpl fileTrustStore = @@ -250,7 +250,7 @@ public class FileTrustStoreTest extends QpidTestCase Map<String,Object> attributes = new HashMap<>(); attributes.put(FileTrustStore.NAME, "myFileTrustStore"); - attributes.put(FileTrustStore.PATH, TestSSLConstants.TRUSTSTORE); + attributes.put(FileTrustStore.STORE_URL, TestSSLConstants.TRUSTSTORE); attributes.put(FileTrustStore.PASSWORD, TestSSLConstants.TRUSTSTORE_PASSWORD); FileTrustStoreImpl fileTrustStore = @@ -281,7 +281,7 @@ public class FileTrustStoreTest extends QpidTestCase Map<String,Object> attributes = new HashMap<>(); attributes.put(FileTrustStore.NAME, "myFileTrustStore"); - attributes.put(FileTrustStore.PATH, TestSSLConstants.TRUSTSTORE); + attributes.put(FileTrustStore.STORE_URL, TestSSLConstants.TRUSTSTORE); attributes.put(FileTrustStore.PASSWORD, TestSSLConstants.TRUSTSTORE_PASSWORD); FileTrustStoreImpl fileTrustStore = |
