add checks for make sure that old handshake operations are done only for old protocol versions
@@ -905,8 +905,9 @@ public final class OConnectionBinaryExecutor implements OBinaryRequestExecutor {
@Override
public OBinaryResponse executeConnect(OConnectRequest request) {
-
OBinaryProtocolHelper.checkProtocolVersion(this, request.getProtocolVersion());
+ if (request.getProtocolVersion() > 36)
+ throw new OConfigurationException("You can use connect as first operation only for protocol < 37 please use handshake for protocol >= 37");
connection.getData().driverName = request.getDriverName();
connection.getData().driverVersion = request.getDriverVersion();
connection.getData().protocolVersion = request.getProtocolVersion();
@@ -919,6 +920,8 @@ public final class OConnectionBinaryExecutor implements OBinaryRequestExecutor {
connection.setServerUser(server.serverLogin(request.getUsername(), request.getPassword(), "server.connect"));
+
+
if (connection.getServerUser() == null)
throw new OSecurityAccessException("Wrong user/password to [connect] to the remote OrientDB Server instance");
@@ -969,7 +972,8 @@ public final class OConnectionBinaryExecutor implements OBinaryRequestExecutor {
@Override
public OBinaryResponse executeDatabaseOpen(OOpenRequest request) {
OBinaryProtocolHelper.checkProtocolVersion(this, request.getProtocolVersion());
-
+ if (request.getProtocolVersion() > 36)
+ throw new OConfigurationException("You can use open as first operation only for protocol < 37 please use handshake for protocol >= 37");
connection.getData().driverName = request.getDriverName();
connection.getData().driverVersion = request.getDriverVersion();
connection.getData().protocolVersion = request.getProtocolVersion();
