cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasobr...@apache.org
Subject git commit: SSL does not work in cassandra-cli.
Date Mon, 06 Oct 2014 21:49:10 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 6eec29ed8 -> df046dfe0


SSL does not work in cassandra-cli.

patch by jasobrown, reviewed by beobal for CASSANDRA-7899


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

Branch: refs/heads/cassandra-2.0
Commit: df046dfe092ea5a08ec0e29a00d30423284d1f86
Parents: 6eec29e
Author: Jason Brown <jasobrown@apple.com>
Authored: Mon Oct 6 14:44:51 2014 -0700
Committer: Jason Brown <jasobrown@apple.com>
Committed: Mon Oct 6 14:44:51 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../cli/transport/FramedTransportFactory.java   | 32 -------------
 .../cli/transport/SSLTransportFactory.java      | 47 --------------------
 .../cassandra/thrift/SSLTransportFactory.java   |  6 +--
 4 files changed, 4 insertions(+), 82 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/df046dfe/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 66d7e72..c811ebf 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.11:
+ * SSL does not work in cassandra-cli (CASSANDRA-7899)
  * Fix potential exception when using ReversedType in DynamicCompositeType
    (CASSANDRA-7898)
  * Better validation of collection values (CASSANDRA-7833)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/df046dfe/src/java/org/apache/cassandra/cli/transport/FramedTransportFactory.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cli/transport/FramedTransportFactory.java b/src/java/org/apache/cassandra/cli/transport/FramedTransportFactory.java
deleted file mode 100644
index dc7ef81..0000000
--- a/src/java/org/apache/cassandra/cli/transport/FramedTransportFactory.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cassandra.cli.transport;
-
-import org.apache.thrift.transport.TFramedTransport;
-import org.apache.thrift.transport.TTransport;
-import org.apache.thrift.transport.TTransportFactory;
-
-public class FramedTransportFactory extends TTransportFactory
-{
-    public static final int DEFAULT_MAX_FRAME_SIZE = 15 * 1024 * 1024; // 15 MiB
-
-    public TTransport getTransport(TTransport base)
-    {
-        return new TFramedTransport(base, DEFAULT_MAX_FRAME_SIZE);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/df046dfe/src/java/org/apache/cassandra/cli/transport/SSLTransportFactory.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cli/transport/SSLTransportFactory.java b/src/java/org/apache/cassandra/cli/transport/SSLTransportFactory.java
deleted file mode 100644
index 4aa9fc1..0000000
--- a/src/java/org/apache/cassandra/cli/transport/SSLTransportFactory.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cassandra.cli.transport;
-
-import org.apache.cassandra.cli.CliMain;
-import org.apache.cassandra.cli.CliSessionState;
-import org.apache.thrift.transport.TSSLTransportFactory;
-import org.apache.thrift.transport.TSSLTransportFactory.TSSLTransportParameters;
-import org.apache.thrift.transport.TTransport;
-import org.apache.thrift.transport.TTransportException;
-import org.apache.thrift.transport.TTransportFactory;
-
-public class SSLTransportFactory extends TTransportFactory
-{
-    private static final int SOCKET_TIMEOUT = 0;
-
-    public TTransport getTransport(TTransport trans)
-    {
-        final CliSessionState sessionState = CliMain.sessionState;
-        try
-        {
-            TSSLTransportParameters params = new TSSLTransportParameters(sessionState.encOptions.protocol,
sessionState.encOptions.cipher_suites);
-            params.setTrustStore(sessionState.encOptions.truststore, sessionState.encOptions.truststore_password);
-            trans = TSSLTransportFactory.getClientSocket(sessionState.hostName, sessionState.thriftPort,
SOCKET_TIMEOUT, params);
-            return new FramedTransportFactory().getTransport(trans);
-        }
-        catch (TTransportException e)
-        {
-            throw new RuntimeException("Failed to create a client SSL connection.", e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/df046dfe/src/java/org/apache/cassandra/thrift/SSLTransportFactory.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/SSLTransportFactory.java b/src/java/org/apache/cassandra/thrift/SSLTransportFactory.java
index f828600..d1bdead 100644
--- a/src/java/org/apache/cassandra/thrift/SSLTransportFactory.java
+++ b/src/java/org/apache/cassandra/thrift/SSLTransportFactory.java
@@ -18,10 +18,9 @@
 package org.apache.cassandra.thrift;
 
 import com.google.common.collect.Sets;
-import org.apache.cassandra.cli.transport.FramedTransportFactory;
+import org.apache.thrift.transport.TFramedTransport;
 import org.apache.thrift.transport.TSSLTransportFactory;
 import org.apache.thrift.transport.TTransport;
-import org.apache.thrift.transport.TTransportException;
 
 import java.util.Map;
 import java.util.Set;
@@ -58,7 +57,8 @@ public class SSLTransportFactory implements ITransportFactory
         if (null != keystore)
             params.setKeyStore(keystore, keystorePassword);
         TTransport trans = TSSLTransportFactory.getClientSocket(host, port, SOCKET_TIMEOUT,
params);
-        return new FramedTransportFactory().getTransport(trans);
+        int frameSize = 15 * 1024 * 1024; // 15 MiB
+        return new TFramedTransport(trans, frameSize);
     }
 
     @Override


Mime
View raw message