Repository: cassandra
Updated Branches:
  refs/heads/trunk 84db205b4 -> 70649a8d6


Add cqlshrc option to always connect using ssl

patch by Stefan Podkowinski; reviewed by Paulo Motta for CASSANDRA-10458


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

Branch: refs/heads/trunk
Commit: 70649a8d65825144fcdbde136d9b6354ef1fb911
Parents: 84db205
Author: Stefan Podkowinski <[email protected]>
Authored: Tue Feb 16 16:08:45 2016 +0100
Committer: Aleksey Yeschenko <[email protected]>
Committed: Mon Feb 29 18:21:05 2016 +0000

----------------------------------------------------------------------
 CHANGES.txt         | 1 +
 bin/cqlsh.py        | 4 +++-
 conf/cqlshrc.sample | 3 +++
 3 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/70649a8d/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 744f06f..26c3166 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.4
+ * (cqlsh) add cqlshrc option to always connect using ssl (CASSANDRA-10458)
  * Cleanup a few resource warnings (CASSANDRA-11085)
  * Allow custom tracing implementations (CASSANDRA-10392)
  * Extract LoaderOptions to be able to be used from outside (CASSANDRA-10637)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/70649a8d/bin/cqlsh.py
----------------------------------------------------------------------
diff --git a/bin/cqlsh.py b/bin/cqlsh.py
index 1c40900..78fedeb 100644
--- a/bin/cqlsh.py
+++ b/bin/cqlsh.py
@@ -179,6 +179,7 @@ from cqlshlib.util import get_file_encoding_bomsize, 
trim_if_present
 
 DEFAULT_HOST = '127.0.0.1'
 DEFAULT_PORT = 9042
+DEFAULT_SSL = False
 DEFAULT_CQLVER = '3.4.0'
 DEFAULT_PROTOCOL_VERSION = 4
 DEFAULT_CONNECT_TIMEOUT_SECONDS = 5
@@ -2440,7 +2441,7 @@ def read_options(cmdlineargs, environment):
 
     optvalues.debug = False
     optvalues.file = None
-    optvalues.ssl = False
+    optvalues.ssl = option_with_default(configs.getboolean, 'connection', 
'ssl', DEFAULT_SSL)
     optvalues.encoding = option_with_default(configs.get, 'ui', 'encoding', 
UTF8)
 
     optvalues.tty = option_with_default(configs.getboolean, 'ui', 'tty', 
sys.stdin.isatty())
@@ -2555,6 +2556,7 @@ def main(options, hostname, port):
         sys.stderr.write("Using CQL driver: %s\n" % (cassandra,))
         sys.stderr.write("Using connect timeout: %s seconds\n" % 
(options.connect_timeout,))
         sys.stderr.write("Using '%s' encoding\n" % (options.encoding,))
+        sys.stderr.write("Using ssl: %s\n" % (options.ssl,))
 
     # create timezone based on settings, environment or auto-detection
     timezone = None

http://git-wip-us.apache.org/repos/asf/cassandra/blob/70649a8d/conf/cqlshrc.sample
----------------------------------------------------------------------
diff --git a/conf/cqlshrc.sample b/conf/cqlshrc.sample
index 462dcc6..c55609f 100644
--- a/conf/cqlshrc.sample
+++ b/conf/cqlshrc.sample
@@ -76,6 +76,9 @@ hostname = 127.0.0.1
 ;; The port to connect to (9042 is the native protocol default)
 port = 9042
 
+;; Always connect using SSL - false by default
+; ssl = true
+
 ;; A timeout in seconds for opening new connections
 ; timeout = 10
 

Reply via email to