Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new option to ignore incoming connection encryption if set #3

Open
wants to merge 1 commit into
base: aiven-3.11.10
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/java/org/apache/cassandra/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ public class Config
public EncryptionOptions.ServerEncryptionOptions encryption_options;
public Boolean listen_on_storage_port;
public Boolean listen_on_ssl_storage_port;
public Boolean external_addressing_mode;

public InternodeCompression internode_compression = InternodeCompression.none;

Expand Down
6 changes: 6 additions & 0 deletions src/java/org/apache/cassandra/config/DatabaseDescriptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -2119,6 +2119,12 @@ public static boolean shouldListenOnStoragePort() {
}
}

public static boolean isExternalAddressingMode() {
if (conf.external_addressing_mode == null)
return false;
return conf.external_addressing_mode;
}

public static boolean shouldListenOnSslStoragePort() {
if (conf.listen_on_ssl_storage_port == null)
return getServerEncryptionOptions().internode_encryption != EncryptionOptions.ServerEncryptionOptions.InternodeEncryption.none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ public void run()
{
logger.warn("Peer {} attempted to establish an unencrypted streaming connection (broadcast address {})",
socket.getRemoteSocketAddress(), init.from);
throw new IOException("Peer " + init.from + " attempted an unencrypted streaming connection");
if (DatabaseDescriptor.isExternalAddressingMode()) {
throw new IOException("Peer " + init.from + " attempted an unencrypted streaming connection");
}
}

//Set SO_TIMEOUT on follower side
Expand Down
4 changes: 3 additions & 1 deletion src/java/org/apache/cassandra/net/IncomingTcpConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ private void receiveMessages() throws IOException
{
logger.warn("Peer {} attempted to establish an unencrypted connection (broadcast address {})",
socket.getRemoteSocketAddress(), from);
throw new IOException("Peer " + from + " attempted an unencrypted connection");
if (DatabaseDescriptor.isExternalAddressingMode()) {
throw new IOException("Peer " + from + " attempted an unencrypted streaming connection");
}
}

// record the (true) version of the endpoint
Expand Down