You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by db...@apache.org on 2013/09/21 05:26:00 UTC

git commit: Do not open non-ssl storage port if encryption option is all patch by dbrosius reviewed by jbellis for cassandra-3916

Updated Branches:
  refs/heads/cassandra-1.2 a0fa69715 -> fb43309b4


Do not open non-ssl storage port if encryption option is all
patch by dbrosius reviewed by jbellis for cassandra-3916


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/fb43309b
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/fb43309b
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/fb43309b

Branch: refs/heads/cassandra-1.2
Commit: fb43309b4741372f777e8ce910cd496299a1ebbf
Parents: a0fa697
Author: Dave Brosius <db...@apache.org>
Authored: Fri Sep 20 23:24:10 2013 -0400
Committer: Dave Brosius <db...@apache.org>
Committed: Fri Sep 20 23:24:10 2013 -0400

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 +
 .../apache/cassandra/net/MessagingService.java  | 75 ++++++++++----------
 2 files changed, 41 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb43309b/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 27e6f24..b4681ae 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,7 @@
 1.2.11
  * Allow cache-keys-to-save to be set at runtime (CASSANDRA-5980)
+ * Allow where clause conditions to be in parenthesis (CASSANDRA-6037)
+ * Do not open non-ssl storage port if encryption option is all (CASSANDRA-3916)
 
 
 1.2.10

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb43309b/src/java/org/apache/cassandra/net/MessagingService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/net/MessagingService.java b/src/java/org/apache/cassandra/net/MessagingService.java
index 2964d35..a199e83 100644
--- a/src/java/org/apache/cassandra/net/MessagingService.java
+++ b/src/java/org/apache/cassandra/net/MessagingService.java
@@ -413,45 +413,48 @@ public final class MessagingService implements MessagingServiceMBean
             logger.info("Starting Encrypted Messaging Service on SSL port {}", DatabaseDescriptor.getSSLStoragePort());
         }
 
-        ServerSocketChannel serverChannel = null;
-        try
-        {
-            serverChannel = ServerSocketChannel.open();
-        }
-        catch (IOException e)
-        {
-            throw new RuntimeException(e);
-        }
-        ServerSocket socket = serverChannel.socket();
-        try
-        {
-            socket.setReuseAddress(true);
-        }
-        catch (SocketException e)
+        if (DatabaseDescriptor.getServerEncryptionOptions().internode_encryption != ServerEncryptionOptions.InternodeEncryption.all)
         {
-            throw new ConfigurationException("Insufficient permissions to setReuseAddress", e);
-        }
-        InetSocketAddress address = new InetSocketAddress(localEp, DatabaseDescriptor.getStoragePort());
-        try
-        {
-            socket.bind(address);
-        }
-        catch (BindException e)
-        {
-            if (e.getMessage().contains("in use"))
-                throw new ConfigurationException(address + " is in use by another process.  Change listen_address:storage_port in cassandra.yaml to values that do not conflict with other services");
-            else if (e.getMessage().contains("Cannot assign requested address"))
-                throw new ConfigurationException("Unable to bind to address " + address
-                                                 + ". Set listen_address in cassandra.yaml to an interface you can bind to, e.g., your private IP address on EC2");
-            else
+            ServerSocketChannel serverChannel = null;
+            try
+            {
+                serverChannel = ServerSocketChannel.open();
+            }
+            catch (IOException e)
+            {
                 throw new RuntimeException(e);
+            }
+            ServerSocket socket = serverChannel.socket();
+            try
+            {
+                socket.setReuseAddress(true);
+            }
+            catch (SocketException e)
+            {
+                throw new ConfigurationException("Insufficient permissions to setReuseAddress", e);
+            }
+            InetSocketAddress address = new InetSocketAddress(localEp, DatabaseDescriptor.getStoragePort());
+            try
+            {
+                socket.bind(address);
+            }
+            catch (BindException e)
+            {
+                if (e.getMessage().contains("in use"))
+                    throw new ConfigurationException(address + " is in use by another process.  Change listen_address:storage_port in cassandra.yaml to values that do not conflict with other services");
+                else if (e.getMessage().contains("Cannot assign requested address"))
+                    throw new ConfigurationException("Unable to bind to address " + address
+                                                     + ". Set listen_address in cassandra.yaml to an interface you can bind to, e.g., your private IP address on EC2");
+                else
+                    throw new RuntimeException(e);
+            }
+            catch (IOException e)
+            {
+                throw new RuntimeException(e);
+            }
+            logger.info("Starting Messaging Service on port {}", DatabaseDescriptor.getStoragePort());
+            ss.add(socket);
         }
-        catch (IOException e)
-        {
-            throw new RuntimeException(e);
-        }
-        logger.info("Starting Messaging Service on port {}", DatabaseDescriptor.getStoragePort());
-        ss.add(socket);
         return ss;
     }