private Transfer initTransfer(ConnectionInfo ci, String db, String server) throws IOException { Socket socket = NetUtils.createSocket(server, Constants.DEFAULT_TCP_PORT, ci.isSSL()); Transfer trans = new Transfer(this, socket); trans.setSSL(ci.isSSL()); trans.init(); trans.writeInt(Constants.TCP_PROTOCOL_VERSION_6); trans.writeInt(Constants.TCP_PROTOCOL_VERSION_12); trans.writeString(db); trans.writeString(ci.getOriginalURL()); trans.writeString(ci.getUserName()); trans.writeBytes(ci.getUserPasswordHash()); trans.writeBytes(ci.getFilePasswordHash()); String[] keys = ci.getKeys(); trans.writeInt(keys.length); for (String key : keys) { trans.writeString(key).writeString(ci.getProperty(key)); } try { done(trans); clientVersion = trans.readInt(); trans.setVersion(clientVersion); trans.writeInt(SessionRemote.SESSION_SET_ID); trans.writeString(sessionId); done(trans); } catch (DbException e) { trans.close(); throw e; } autoCommit = true; return trans; }