diff --git a/bridge/src/main/kotlin/net/corda/bridge/services/artemis/BridgeArtemisConnectionServiceImpl.kt b/bridge/src/main/kotlin/net/corda/bridge/services/artemis/BridgeArtemisConnectionServiceImpl.kt index e640abe767..5808b5ab8d 100644 --- a/bridge/src/main/kotlin/net/corda/bridge/services/artemis/BridgeArtemisConnectionServiceImpl.kt +++ b/bridge/src/main/kotlin/net/corda/bridge/services/artemis/BridgeArtemisConnectionServiceImpl.kt @@ -18,7 +18,6 @@ import net.corda.core.internal.ThreadBox import net.corda.core.serialization.internal.nodeSerializationEnv import net.corda.core.utilities.contextLogger import net.corda.nodeapi.ArtemisTcpTransport -import net.corda.nodeapi.ConnectionDirection import net.corda.nodeapi.internal.ArtemisMessagingClient import net.corda.nodeapi.internal.ArtemisMessagingComponent import org.apache.activemq.artemis.api.core.client.ActiveMQClient @@ -72,7 +71,7 @@ class BridgeArtemisConnectionServiceImpl(val conf: BridgeConfiguration, log.info("Connecting to message broker: ${outboundConf.artemisBrokerAddress}") val brokerAddresses = listOf(outboundConf.artemisBrokerAddress) + outboundConf.alternateArtemisBrokerAddresses // TODO Add broker CN to config for host verification in case the embedded broker isn't used - val tcpTransports = brokerAddresses.map { ArtemisTcpTransport.tcpTransport(ConnectionDirection.Outbound(), it, sslConfiguration) } + val tcpTransports = brokerAddresses.map { ArtemisTcpTransport.p2pConnectorTcpTransport(it, sslConfiguration) } locator = ActiveMQClient.createServerLocatorWithoutHA(*tcpTransports.toTypedArray()).apply { // Never time out on our loopback Artemis connections. If we switch back to using the InVM transport this // would be the default and the two lines below can be deleted. @@ -146,8 +145,8 @@ class BridgeArtemisConnectionServiceImpl(val conf: BridgeConfiguration, latch.countDown() } } - val newSession = newSessionFactory.createSession(ArtemisMessagingComponent.NODE_USER, - ArtemisMessagingComponent.NODE_USER, + val newSession = newSessionFactory.createSession(ArtemisMessagingComponent.NODE_P2P_USER, + ArtemisMessagingComponent.NODE_P2P_USER, false, true, true, diff --git a/bridge/src/main/kotlin/net/corda/bridge/services/filter/SimpleMessageFilterService.kt b/bridge/src/main/kotlin/net/corda/bridge/services/filter/SimpleMessageFilterService.kt index 7edf17e8b3..39f79b8137 100644 --- a/bridge/src/main/kotlin/net/corda/bridge/services/filter/SimpleMessageFilterService.kt +++ b/bridge/src/main/kotlin/net/corda/bridge/services/filter/SimpleMessageFilterService.kt @@ -46,7 +46,7 @@ class SimpleMessageFilterService(val conf: BridgeConfiguration, override fun start() { statusSubscriber = statusFollower.activeChange.subscribe { if (it) { - inboundSession = artemisConnectionService.started!!.sessionFactory.createSession(ArtemisMessagingComponent.NODE_USER, ArtemisMessagingComponent.NODE_USER, false, true, true, false, ActiveMQClient.DEFAULT_ACK_BATCH_SIZE) + inboundSession = artemisConnectionService.started!!.sessionFactory.createSession(ArtemisMessagingComponent.NODE_P2P_USER, ArtemisMessagingComponent.NODE_P2P_USER, false, true, true, false, ActiveMQClient.DEFAULT_ACK_BATCH_SIZE) inboundProducer = inboundSession!!.createProducer() } else { inboundProducer?.close() diff --git a/bridge/src/test/kotlin/net/corda/bridge/services/FilterServiceTest.kt b/bridge/src/test/kotlin/net/corda/bridge/services/FilterServiceTest.kt index 8795b91c44..7763d082e2 100644 --- a/bridge/src/test/kotlin/net/corda/bridge/services/FilterServiceTest.kt +++ b/bridge/src/test/kotlin/net/corda/bridge/services/FilterServiceTest.kt @@ -59,7 +59,7 @@ class FilterServiceTest { val artemisStarted = ArtemisMessagingClient.Started( rigorousMock(), rigorousMock().also { - doReturn(dummySession).whenever(it).createSession(ArtemisMessagingComponent.NODE_USER, ArtemisMessagingComponent.NODE_USER, false, true, true, false, ActiveMQClient.DEFAULT_ACK_BATCH_SIZE) + doReturn(dummySession).whenever(it).createSession(ArtemisMessagingComponent.NODE_P2P_USER, ArtemisMessagingComponent.NODE_P2P_USER, false, true, true, false, ActiveMQClient.DEFAULT_ACK_BATCH_SIZE) }, rigorousMock(), rigorousMock() @@ -130,7 +130,7 @@ class FilterServiceTest { val artemisStarted = ArtemisMessagingClient.Started( rigorousMock(), rigorousMock().also { - doReturn(dummySession).whenever(it).createSession(ArtemisMessagingComponent.NODE_USER, ArtemisMessagingComponent.NODE_USER, false, true, true, false, ActiveMQClient.DEFAULT_ACK_BATCH_SIZE) + doReturn(dummySession).whenever(it).createSession(ArtemisMessagingComponent.NODE_P2P_USER, ArtemisMessagingComponent.NODE_P2P_USER, false, true, true, false, ActiveMQClient.DEFAULT_ACK_BATCH_SIZE) }, rigorousMock(), rigorousMock() diff --git a/client/rpc/src/main/kotlin/net/corda/client/rpc/CordaRPCClient.kt b/client/rpc/src/main/kotlin/net/corda/client/rpc/CordaRPCClient.kt index cafbb95371..564b373c4d 100644 --- a/client/rpc/src/main/kotlin/net/corda/client/rpc/CordaRPCClient.kt +++ b/client/rpc/src/main/kotlin/net/corda/client/rpc/CordaRPCClient.kt @@ -153,14 +153,6 @@ class CordaRPCClient private constructor( return CordaRPCClient(haAddressPool.first(), configuration, sslConfiguration, haAddressPool = haAddressPool) } - internal fun createWithSsl( - haAddressPool: List, - configuration: CordaRPCClientConfiguration = CordaRPCClientConfiguration.default(), - sslConfiguration: SSLConfiguration? = null - ): CordaRPCClient { - return CordaRPCClient(haAddressPool.first(), configuration, sslConfiguration, null, haAddressPool) - } - internal fun createWithSslAndClassLoader( hostAndPort: NetworkHostAndPort, configuration: CordaRPCClientConfiguration = CordaRPCClientConfiguration.default(), @@ -185,7 +177,7 @@ class CordaRPCClient private constructor( sslConfiguration: ClientRpcSslOptions? = null, classLoader: ClassLoader? = null ): CordaRPCClient { - return CordaRPCClient(haAddressPool.first(), configuration, sslConfiguration, classLoader, haAddressPool) + return CordaRPCClient(haAddressPool.first(), configuration, sslConfiguration, null, classLoader, haAddressPool) } } diff --git a/node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcSslTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcSslTest.kt index 8c5a282811..10b9a184d8 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcSslTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcSslTest.kt @@ -17,6 +17,10 @@ import net.corda.node.services.Permissions.Companion.all import net.corda.nodeapi.BrokerRpcSslOptions import net.corda.core.messaging.ClientRpcSslOptions import net.corda.nodeapi.internal.ArtemisMessagingComponent.Companion.NODE_RPC_USER +import net.corda.testing.core.ALICE_NAME +import net.corda.testing.core.BOB_NAME +import net.corda.testing.core.DUMMY_BANK_A_NAME +import net.corda.testing.core.DUMMY_NOTARY_NAME import net.corda.testing.driver.DriverParameters import net.corda.testing.driver.driver import net.corda.testing.driver.internal.RandomFree diff --git a/node/src/main/kotlin/net/corda/node/services/config/ConfigUtilities.kt b/node/src/main/kotlin/net/corda/node/services/config/ConfigUtilities.kt index 02914512a9..f9803a2820 100644 --- a/node/src/main/kotlin/net/corda/node/services/config/ConfigUtilities.kt +++ b/node/src/main/kotlin/net/corda/node/services/config/ConfigUtilities.kt @@ -34,7 +34,7 @@ operator fun Config.plus(overrides: Map): Config = ConfigFactory.p object ConfigHelper { - private const val CORDA_PROPERTY_PREFIX = "corda." + const val CORDA_PROPERTY_PREFIX = "corda." private val log = LoggerFactory.getLogger(javaClass) fun loadConfig(baseDirectory: Path, diff --git a/node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt b/node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt index 2ac067df96..502aa4cae8 100644 --- a/node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt +++ b/node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt @@ -19,17 +19,12 @@ import net.corda.core.utilities.loggerFor import net.corda.core.utilities.seconds import net.corda.node.internal.artemis.CertificateChainCheckPolicy import net.corda.node.services.config.rpc.NodeRpcOptions +import net.corda.nodeapi.BrokerRpcSslOptions import net.corda.nodeapi.internal.config.NodeSSLConfiguration -import net.corda.nodeapi.internal.config.SSLConfiguration import net.corda.nodeapi.internal.config.UnknownConfigKeysPolicy import net.corda.nodeapi.internal.config.User import net.corda.nodeapi.internal.config.parseAs import net.corda.nodeapi.internal.persistence.CordaPersistence.DataSourceConfigTag -import net.corda.nodeapi.internal.config.* -import net.corda.nodeapi.BrokerRpcSslOptions -import net.corda.nodeapi.internal.config.NodeSSLConfiguration -import net.corda.nodeapi.internal.config.User -import net.corda.nodeapi.internal.config.parseAs import net.corda.nodeapi.internal.persistence.DatabaseConfig import net.corda.tools.shell.SSHDConfiguration import org.slf4j.Logger