Skip to content

Commit 43dbcd7

Browse files
committed
Send pre-auth real nodeId
1 parent 3360738 commit 43dbcd7

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/CoreProtocolManager.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,17 +323,19 @@ public void handlePacket(final Packet packet) {
323323
// receives a topology message before proceeding to CREATE_SESSION). The dummy response
324324
// uses PRE_AUTH_NODE_ID and an empty connector pair so no real broker identity or
325325
// connectivity information is disclosed to unauthenticated callers.
326-
preAuthTopologySent = true;
326+
//preAuthTopologySent = true;
327+
//String preAuthTopologyNodeId = Topology.PRE_AUTH_NODE_ID;
328+
String preAuthTopologyNodeId = server.getNodeID().toString();
327329
Pair<TransportConfiguration, TransportConfiguration> emptyConfig = new Pair<>(null, null);
328330
entry.connectionExecutor.execute(() -> {
329331
if (channel0.supports(PacketImpl.CLUSTER_TOPOLOGY_V4)) {
330-
channel0.send(new ClusterTopologyChangeMessage_V4(System.currentTimeMillis(), Topology.PRE_AUTH_NODE_ID,
332+
channel0.send(new ClusterTopologyChangeMessage_V4(System.currentTimeMillis(), preAuthTopologyNodeId,
331333
null, null, emptyConfig, true, server.getVersion().getIncrementingVersion()));
332334
} else if (channel0.supports(PacketImpl.CLUSTER_TOPOLOGY_V2)) {
333335
channel0.send(new ClusterTopologyChangeMessage_V2(System.currentTimeMillis(),
334-
Topology.PRE_AUTH_NODE_ID, null, emptyConfig, true));
336+
preAuthTopologyNodeId, null, emptyConfig, true));
335337
} else {
336-
channel0.send(new ClusterTopologyChangeMessage(Topology.PRE_AUTH_NODE_ID, emptyConfig, true));
338+
channel0.send(new ClusterTopologyChangeMessage(preAuthTopologyNodeId, emptyConfig, true));
337339
}
338340
});
339341

0 commit comments

Comments
 (0)