81 Commits

Author SHA1 Message Date
Matthew Nesbit
51e9ef0cc0 Initial stage of Bully Algorithm Leader election
Some artemis reconnect logic

Fix disconnect behaviour of BullyLeader code and improve Artemis shutdown behaviour when disconnected.

Integrate Bully Algorithm leader elector with the bridge

Fix docs

Remove pointless header change
2018-11-09 09:34:44 +00:00
Matthew Nesbit
0b134eee86 Improve artemis client shutdown time when disconnected and don't block on commit if Artemis is already closing. 2018-11-08 17:04:13 +00:00
bpaunescu
41f5c530b2
ENT-2577 Custom SSL props for external Artemis connections (#1549)
* ENT-2577 added additional node config for external artemis ssl config

* ENT-2577 update tests for external p2p broker

* ENT-2577 rename new config
2018-11-08 16:31:02 +00:00
Viktor Kolomeyko
7a62e65ec7
ENT-2681: Re-throw original exception when parsing using old format failed. (#1550)
* ENT-2681: Add explicit warning in the log explaining why parsing according to new configuration format has failed.
(Before trying ot use old config format)

* ENT-2681: Correctly report original error when parsing using old config format failed.
2018-11-08 13:26:07 +00:00
Viktor Kolomeyko
400346fff0
ENT-2669: Introduce option for HTTP proxy for outbound Bridge connectivity (#1537)
* ENT-2669: Introduce option for HTTP proxy for outbound Bridge connectivity

One of our customers currently using HTTP proxy without which outbound connection from Corda Node cannot be established.
Also, propagate `trace` setting correctly down the Bridge stack.

* ENT-2669: Compilation fixes.

* ENT-2669: Revert deleted constructor back.

* ENT-2669: First stub on HTTP Proxy integration test.

* ENT-2669: Minor changes.

* ENT-2669: Reduce test to bare minimum.

* ENT-2669: Attempt to write own HttpProxy.

* ENT-2669: Another attempt to make programmatic HttpProxy work.

* ENT-2697: Disable DNS resolution before sending requests to proxies.

* ENT-2669: Switch to use Jetty HttpProxy for integration testing.

* Adds a pipeline logger ahead of the proxy stage if trace is set. The logging is removed once the proxy completes.

Define a constant for pipeline stage.
2018-11-08 09:04:36 +00:00
bpaunescu
9a778b0097
ENT-2655: added a lock on leader status to ensure no clients can be leader at the same time (#1517)
* ENT-2655: added a lock on leader status to ensure no clients can be leader at the same time

* ENT-2655: reworked tests to not use hacky timeouts, now check for max 1 leader at any given time, improved error handling in the latch

* ENT-2655: address PR comments and use atomic int properly
2018-11-06 10:48:11 +00:00
Viktor Kolomeyko
513305ee7d
ENT-2669: SocksProxy rename into Proxy (#1533)
* ENT-2669: Rename SocksProxyVersion into ProxyVersion

* ENT-2669: Rename SocksProxyConfig into ProxyConfig

Update documentation and make code changes such that old style configs are still parsed.

* ENT-2669: Changelog update
2018-11-02 16:07:41 +00:00
Michele Sollecito
6fb2996fd6
[ENT-2678]: PluginRegistrationTest.test plugin registration is failing (fix) (#1535) 2018-11-02 14:01:14 +00:00
Viktor Kolomeyko
b1502c98f8
ENT-2681: Ensure we can parse old style bridge configs. (#1529)
* ENT-2681: Ensure we can parse old style bridge configs.

* ENT-2681: Minor change

* ENT-2681: Minor change
2018-11-02 10:45:52 +00:00
Patrick Kuo
5d1362bca6
[ENT-2624] Disable switch for SNI functionality (#1487)
* [ENT-2624] Disable switch for SNI functionality

* * Add SNI switch to driver
* Make BridgeRestartTest test for both enableSNI = true and false
2018-11-01 11:15:24 +00:00
bpaunescu
c8b65c933f
Ent 1394 ha artemis (#1428)
* ENT-1394: artemis locators for HA bases on configuration

* ENT-1394: bridge artemis connection service with HA impl

* ENT-1394: added own round robin logic for artemis client connections

* ENT-1394: added support for external clustered artemis to internal RPC client

* ENT-1394: added failover listener to internal rpc client, some cleanup

* ENT-1394: remove unused import

* ENT-1394: refactored after rebasing

* ENT-1394: refactored after rebasing, addressed PR comments

* ENT-1394: got rid of HA connection service in favor of a simple check inside current one

* ENT-1394: ha locator gets its own thread to handle failover that happens behind the scenes

* ENT-1394: move ha artemis flag in the outboundConfig

* ENT-1394: haArtemis flag has default value in constructor

* ENT-1394: address PR comment, handle status change during failover

* ENT-1394: reverted usage of ha locator

* ENT-1394: ensure that on failover the p2pclient sends a fresh snapshot to the bridge
2018-10-25 15:21:26 +01:00
Viktor Kolomeyko
63f80d1fb5
ENT-2636: Introduce healthCheckPhrase which can be used for TCP Echo check (#1504)
* ENT-2636: Introduce ModeSelectingChannel

Next step: Add an integration test.

* ENT-2636: Explicitly retain/release ByteBuf

* ENT-2636: Use ByteBuf API and stop using `java.nio.ByteBuffer`

* ENT-2636: Add new optional FirewallConfiguration parameter

* ENT-2636: Simplify implementation of ModeSelectingChannel

* ENT-2610: Create integration test to check response on TCP call and fixes to ModeSelectingChannel

* ENT-2610: Extend integration test fixes to ModeSelectingChannel

Doesn't currently work well for longer messages.

* ENT-2610: Extend integration test fixes to ModeSelectingChannel

Doesn't currently work well for longer messages.

* ENT-2610: Fixes to ModeSelectingChannel so it works well for longer messages.

* ENT-2610: Reflect `healthCheckPhrase` from `FirewallConfiguration` onto `AMQPConfiguration`

* ENT-2610: Incorporate review comments by @mnesbit

* ENT-2636: Extend the test to drip feed bytes one-by-one.

Also remove TRACE level packet logging for speed and log space reduction.

Logging-wise the following printed into the log every time TCP echo performed:
```
[INFO] 11:03:16,016 [nioEventLoopGroup-5-1] logging.LoggingHandler.info - [id: 0x202c2137, L:/0:0:0:0:0:0:0:0:10001] READ: [id: 0x073fda76, L:/10.18.1.203:10001 - R:/10.18.1.203:59274]
[INFO] 11:03:16,016 [nioEventLoopGroup-5-1] logging.LoggingHandler.info - [id: 0x202c2137, L:/0:0:0:0:0:0:0:0:10001] READ COMPLETE
[INFO] 11:03:16,018 [nioEventLoopGroup-6-4] netty.AMQPChannelHandler.invoke - New client connection 073fda76 from /10.18.1.203:59274 to /10.18.1.203:10001 {allowedRemoteLegalNames=null, localCert=null, remoteAddress=/10.18.1.203:59274, remoteCert=null, serverMode=true}
```
2018-10-25 12:33:30 +01:00
Anthony Keenan
abfe538e6e
ENT-2611: Standardise CLI for corda firewall (#1503)
* Update firewall to use picocli

* Update documentation

* Remove joptsimple dependency

* Fix broken tests

* Grammar fix
2018-10-25 08:37:20 +01:00
szymonsztuka
d1abdf9118
Integration test updates to run in database mode, Fix notary Liquibase file names (#1502) 2018-10-24 10:43:35 +01:00
Viktor Kolomeyko
19b4e68903
ENT-2610: Separate passwords for store and for private keys (#1483)
* ENT-2610: Documentation update to include optional `keyStorePrivateKeyPassword`.

* ENT-2610: Documentation update to include optional `keyStorePrivateKeyPassword`.

* ENT-2610: Disruptive change to `CertificateStore` (will cause compilation failures)

* ENT-2610: Address compilation failures caused by separation of `storePassword` and `keyPassword` e.g. in `X509KeyStore`

* ENT-2610: Docs update to flag that passwords have to be the same due to Artemis limitations.

* ENT-2610: Make changes to `bridge` module.

Make private key password optional in `BridgeSSLConfigurationImpl` and extend `ConfigTest`.
Also improve exception reporting when necessary option is missing.

* ENT-2610: Fixes to `bridge` integration tests.

* ENT-2610: Whenever it comes to Dev node certificates ensure that private key password is the same as store password
or else Artemis is not going to accept that, see comment in DevIdentityGenerator.

* ENT-2610: More unit test fixes

* ENT-2610: More integration tests fixes

* ENT-2610: Fix netty code to use `privateKeyPassword` where necessary

* ENT-2610: Remove the use of `keyPassword` for `trustStore`

* ENT-2610: Compilation fixes after merge from `master`

* ENT-2610: Add an integration test which proves that diff. passwords work
2018-10-23 16:05:08 +01:00
Viktor Kolomeyko
9090b69c1c
ENT-2610: Fix BridgeSmokeTest post merge from OS (#1498) 2018-10-23 11:09:04 +01:00
Viktor Kolomeyko
23732ece4e More compilation fixes after OS merge 2018-10-22 13:19:30 +01:00
Viktor Kolomeyko
440c8d2da2 Compilation fixes after OS merge + quasar.jar upgrade 2018-10-22 13:07:43 +01:00
Patrick Kuo
873b1f2fcd
ENT-2573 Add feedback logic for messages (#1475)
* Message loopback for nodes sharing the same bridge

* address PR issue
2018-10-16 10:27:05 +01:00
Andrius Dagys
ff7496ed20 Minor: replace branch name with commit hash for caffeine dependency.
This fixes the issue where Intellij loops for ages to try and resolve it from the artifactory.
2018-10-12 15:13:19 +01:00
bpaunescu
ba271f7adc
Bogdan ent 2295 SNI (#1435)
* ENT-2295: added SNI support to bridge

* ENT-2295: removed unused method args, adde new line

* ENT-2295: fix checking for existing bridges

* ENT-2295: fix AMQPBridgeTest(included source x500 name in messages)

* ENT-2295: fix ProtonWrapperTests (added source id and only check for SNI if bridge is shared)

* ENT-2295: fixed issue with artemis round robin not working when autogrouping was on

* ENT-2295: adapt to use openSSL, added SNI tests

* ENT-2295: server side openSSL now uses SniHandler magic

* ENT-2295: service queues are not exclusive

* ENT-2295: remove check for nodes sharing artemis when resolving targets

* ENT-2516 SNI - Log the requested server name (if any) in the AMQPServer (#1454)

* WIP

* log server name in ssl handshake

* big fix

* handle nullable sslParameters

* ENT-2295: address PR comments

* ENT-2295: remove unused imports

* ENT-2295: fix warnings

* ENT-2295: address PR comments

* ENT-2295: added node to node intergration tests, added openssl dep to bridge capsule

* ENT-2295: message group id is unique for service queues

* ENT-2295: address PR comment
2018-10-12 12:24:54 +01:00
Anthony Keenan
b260f8a60a Another slight change needed here 2018-10-09 16:32:51 +01:00
Rick Parker
06002af81f
ENT-2408 Jitpack version of Caffeine with 50% window size. (#1352)
(cherry picked from commit 722824d)
2018-10-05 11:20:10 +01:00
Viktor Kolomeyko
95de18b1ca
ENT-2500: Improve formatting when no traffic flown through Bridge. (#1447)
Without this change the following output can be observed:
```
...
Traffic breakdown:
	Successful connections in:

	Successful connections out:

	Failed connections in:

	Failed connections out:

	Accepted packets in:

	Accepted packets out:

	Dropped packets in:

	Dropped packets out:
```
2018-10-04 13:59:07 +01:00
Viktor Kolomeyko
50a1819e47
ENT-2559: Gracefully handle Artemis connectivity loss during Bridge leader election (#1436)
* ENT-2559: KDocs update and change visibility identifiers.

* ENT-2559: Handle upstream dependencies going up and down.

* ENT-2500: Address code review comments by @mnesbit
2018-10-03 18:56:15 +01:00
Viktor Kolomeyko
8c23abbd7a
ENT-2500: Corda Firewall should log some packet statistics (#1426)
* ENT-2500: Refactoring to allow FirewallAuditService have inbound as well as outbound logging.

Change some visibility modifiers to `private`. Use in-place initialisation where possible.

* ENT-2500: Record accepted package coming into Float

* ENT-2500: Introduce optional BridgeAuditService in `nodeApi` module

* ENT-2500: Switch FirewallAuditService to use `ApplicationMessage` and bind outgoing message stats.

* ENT-2500: Introduce scheduled executor and audit service configuration.

* ENT-2500: Stats formatting.

* ENT-2500: Stats formatting unit test.

* ENT-2500: Minor changes to LoggingFirewallAuditService and its unit test.

* ENT-2500: Additional configuration parameter documentation update.

* ENT-2500: Supply optional parameter.

* ENT-2500: Address PR comments.

* ENT-2500: Make API more consistent by using `RoutingDirection`, re-jig `State` data structure, improve unit test.

* ENT-2500: Add breakdown by endpoint address.

* ENT-2500: Compilation fix after rebase in `master`.

* ENT-2500: Making `AuditServiceConfiguration` not optional and supplying default settings.
Also few minor changes.
2018-10-02 14:13:08 +01:00
Christian Sailer
532d95ccac
ENT-1565 Enable the use of BoringSSL (#1358)
* BoringSsl dependency

* Merge over boring_ssl changes

* Merge over boring_ssl changes

*  Upgrade netty-tcnative (and netty to compatible version)

* Add openSSL flag to SSLConfiguration and implementations.

* Make SSL implementation switchable for Artemis

* Parameterize AMQP bridge tests on use of openSSL

* Plumb through open SSL flag to AMQP client/server.

* Add open ssl flag to reference.conf

* Slight clean-up

* Add LoggingTrustManagerWrapper for OpenSsl contexts

* Remove unneeded lazy and check for double wrapping

* Fix TrustMangerWrapper and test, clean-up

* Add key factory wrapper to get the current certificate chain out.

* Use cert chain returning key mananager factory to get local cert

* Force consistent netty-tcnative version across all dependencies

* Make proton wrapper tests check all combinations of client/server native/java SSL

* Add test netty server/client to run SSL tests with

* Simplify usage of test netty components and clean up

* Improve exception handling in NettyTestHandler

* Add openSSL test for X509UtilitiesTests

* Expose engine for test usage

* Add the X509 peer chain check from the socket based test

* Port of TLSAuthenticationTests to use Netty so we can use different SSL providers, add boringSSL tests

* Adapt tests to new config structure

* Readd `useOpenSsl` configuration

* Readd `useOpenSsl` configuration

* Fix up ArtemisTransport for OpenSSL plus tests

* Adapt auth tests

* Formatting

* Remove obsolte file

* Fix config misnomer

* Add SNI host logic to OpenSSL execution branch

* Remove TLS_DHE_RSA tests

* Make exception handling in the netty test infra deterministic
2018-10-01 13:59:52 +01:00
Chris Rankin
ea38c35792 CORDA-1985: Upgrade Enterprise modules to Capsule 1.0.3. 2018-09-17 14:08:48 +01:00
Michele Sollecito
ce0bf9eb2e Fixing compilation. 2018-09-05 13:11:53 +01:00
Michele Sollecito
0b495098a8 [CORDA-1937]: Fixes to enterprise float and bridge. 2018-09-04 17:33:05 +01:00
Michele Sollecito
31e58dd2e5 [CORDA-1937]: Fixes to enterprise float and bridge. 2018-09-04 11:20:34 +01:00
Shams Asari
11e2bef240
ENT-2473: Removed copyright headers (#1364) 2018-09-03 16:38:52 +01:00
Thomas Schroeter
047489ba7e
Allow base dir and config file (#1331) 2018-08-17 13:55:41 +01:00
Chris Rankin
1f74d957ff Merge commit '0b0ad71b3c38c176f85501882de0d4f4c884bfc6' into chrisr3-os-merge 2018-07-25 10:43:57 +01:00
Michele Sollecito
927c6ab28b Fixed a compilation error. 2018-07-23 16:53:50 +01:00
Stefano Franz
480698bc46 Merge remote-tracking branch 'open/master' into my-merge-july-11-11-27
# Conflicts:
#	CONTRIBUTORS.md
2018-07-11 11:37:49 +01:00
Viktor Kolomeyko
1f5520ca40
CORDA-1743: Remove "isDebug = true" leftovers in the Enterprise. (#1236) 2018-07-11 10:28:40 +01:00
Shams Asari
04809538cd Merge fix 2018-07-09 12:39:43 +01:00
Shams Asari
300e0573fe
Merge pull request #1205 from corda/os-merge-244167d
O/S merge from 244167d
2018-07-05 17:16:52 +01:00
Shams Asari
0c8c914882 Removing warnings 2018-07-05 15:45:28 +01:00
Matthew Nesbit
123a2af5e0 Bridge to Firewall renames
More renaming

Update diagrams

Update changelog to point out breaking change fo the rename

Address Richard's PR comments
2018-07-05 15:20:28 +01:00
Matthew Nesbit
0d18bf8e33 Merge up of cleanup of AMQP protocol code 2018-07-03 17:05:05 +01:00
szymonsztuka
2d61c76d9d Fix integration test in database mode for test added in ENT-2053 (#1138) 2018-06-29 09:52:36 +01:00
bpaunescu
ddcdb370b3
ENT-2053 Artemis cleanup fix (#987)
* Bridge kill test

Fix Artemis settings

ENT-2053: add quasar for gradle file

Add several flow + bridge kill test

Debugging

Potential fix

* ENT-2053: create p2p queues in exclusive mode to avoid reordering when bridge is killed

* ENT-2053: add exclusive flag to rest of p2p queues

* ENT-2053: check addresses' types when creating queues for exclusive mode

* Revert "Debugging"

This reverts commit d48a49c91f3fba0609b9b744c78fc671f4a92076.

* ENT-2053:address PR comments
2018-06-20 13:06:24 +01:00
Rick Parker
c7c38fd91c
ENT-2053 Fix messaging TTL related settings causing disconnects (#1011) 2018-06-18 17:40:03 +01:00
Matthew Nesbit
8af17d4c3e During testing I observed a race condition where the bridge losing master status was terminated by the dual bridge detection logic. This code defers teh m,aster claim a few seconds to prevent thsi race condition. 2018-05-31 14:32:20 +01:00
Matthew Nesbit
f98bf4db14 The Artemis reconnection logic failed in test, because there were active artemis bridge connections. Correct the integration test, fix the bridging code and log all onError cases in the bridge. 2018-05-29 18:14:35 +01:00
Shams Asari
62f12dde11 Merge fixes, including removing dependency to Kryo in the bridge and removing the kryo serialisation scheme for the enclave. 2018-05-24 13:32:09 +01:00
Tudor Malene
7a08ebca5a Fix merge 2018-05-21 14:37:59 +01:00
Shams Asari
210a0bc9a5 Merge branch 'master' into os-merge-2907250 2018-05-21 11:26:23 +01:00