Added log WARN in discovery when ssl cfg isn't consistent.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f6b3b3d3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f6b3b3d3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f6b3b3d3 Branch: refs/heads/ignite-1139 Commit: f6b3b3d37a31dc69d7d9db8fb30a7379f8f042c0 Parents: 2650845 Author: nikolay_tikhonov <ntikho...@gridgain.com> Authored: Wed Jul 22 13:05:21 2015 +0300 Committer: nikolay_tikhonov <ntikho...@gridgain.com> Committed: Wed Jul 22 13:05:21 2015 +0300 ---------------------------------------------------------------------- .../apache/ignite/spi/discovery/tcp/ServerImpl.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f6b3b3d3/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java index 97e910a..34f90f7 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java @@ -39,6 +39,7 @@ import org.apache.ignite.spi.discovery.tcp.messages.*; import org.jetbrains.annotations.*; import org.jsr166.*; +import javax.net.ssl.*; import java.io.*; import java.net.*; import java.util.*; @@ -4123,12 +4124,16 @@ class ServerImpl extends TcpDiscoveryImpl { if (!Arrays.equals(buf, U.IGNITE_HEADER)) { if (log.isDebugEnabled()) log.debug("Unknown connection detected (is some other software connecting to " + - "this Ignite port?) " + + "this Ignite port?" + + (!spi.isSslEnabled() ? " missed SSL configuration?" : "" ) + + ") " + "[rmtAddr=" + sock.getRemoteSocketAddress() + ", locAddr=" + sock.getLocalSocketAddress() + ']'); LT.warn(log, null, "Unknown connection detected (is some other software connecting to " + - "this Ignite port?) [rmtAddr=" + sock.getRemoteSocketAddress() + + "this Ignite port?" + + (!spi.isSslEnabled() ? " missed SSL configuration?" : "" ) + + ") [rmtAddr=" + sock.getRemoteSocketAddress() + ", locAddr=" + sock.getLocalSocketAddress() + ']'); return; @@ -4237,7 +4242,10 @@ class ServerImpl extends TcpDiscoveryImpl { if (log.isDebugEnabled()) U.error(log, "Caught exception on handshake [err=" + e +", sock=" + sock + ']', e); - if (X.hasCause(e, ObjectStreamException.class) || !sock.isClosed()) { + if (X.hasCause(e, SSLException.class) && spi.isSslEnabled()) + LT.warn(log, null, "Failed to initialize connection. Not encrypted data received. " + + "Missed SSL configuration on node? [sock=" + sock + ']'); + else if (X.hasCause(e, ObjectStreamException.class) || !sock.isClosed()) { if (U.isMacInvalidArgumentError(e)) LT.error(log, e, "Failed to initialize connection [sock=" + sock + "]\n\t" + U.MAC_INVALID_ARG_MSG);