summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmjith Ramanujam <amjith.r@gmail.com>2022-08-26 06:28:22 -0700
committerGitHub <noreply@github.com>2022-08-26 06:28:22 -0700
commit09ee2027cd8b513eff11d7da6f1908528e65f216 (patch)
treefe17bad10114f5c2ed2f4cfcd8338d137f2f4139
parentba34257a0f02ea5d62412ba4c9d529cf38412397 (diff)
parentabfb63651c69409ac8803c60a144917fd36935e6 (diff)
Merge pull request #1072 from meldafert/ssl-flag
Add cli flag --ssl to enable ssl
-rw-r--r--README.md2
-rw-r--r--changelog.md3
-rw-r--r--mycli/AUTHORS1
-rwxr-xr-xmycli/main.py5
4 files changed, 10 insertions, 1 deletions
diff --git a/README.md b/README.md
index e15f505..e77ba7b 100644
--- a/README.md
+++ b/README.md
@@ -69,6 +69,8 @@ $ sudo apt-get install mycli # Only on debian or ubuntu
--ssh-config-host TEXT Host to connect to ssh server reading from ssh
configuration.
+ --ssl Enable SSL for connection (automatically
+ enabled with other flags).
--ssl-ca PATH CA file in PEM format.
--ssl-capath TEXT CA directory.
--ssl-cert PATH X509 cert in PEM format.
diff --git a/changelog.md b/changelog.md
index 6e313cf..d79389b 100644
--- a/changelog.md
+++ b/changelog.md
@@ -4,8 +4,11 @@ TBD
Features:
---------
+
+* Add `--ssl` flag to enable ssl/tls.
* Add `pager` option to `~/.myclirc`, for instance `pager = 'pspg --csv'` (Thanks: [BuonOmo])
+
Internal:
---------
* Pin `cryptography` to suppress `paramiko` warning, helping CI complete and presumably affecting some users.
diff --git a/mycli/AUTHORS b/mycli/AUTHORS
index da3fb9b..a805465 100644
--- a/mycli/AUTHORS
+++ b/mycli/AUTHORS
@@ -93,6 +93,7 @@ Contributors:
* Zhongyang Guan
* Arvind Mishra
* Kevin Schmeichel
+ * Mel Dafert
Created by:
-----------
diff --git a/mycli/main.py b/mycli/main.py
index 7a654b7..139ed34 100755
--- a/mycli/main.py
+++ b/mycli/main.py
@@ -1090,6 +1090,8 @@ class MyCli(object):
@click.option('--ssh-config-path', help='Path to ssh configuration.',
default=os.path.expanduser('~') + '/.ssh/config')
@click.option('--ssh-config-host', help='Host to connect to ssh server reading from ssh configuration.')
+@click.option('--ssl', 'ssl_enable', is_flag=True,
+ help='Enable SSL for connection (automatically enabled with other flags).')
@click.option('--ssl-ca', help='CA file in PEM format.',
type=click.Path(exists=True))
@click.option('--ssl-capath', help='CA directory.')
@@ -1148,7 +1150,7 @@ class MyCli(object):
def cli(database, user, host, port, socket, password, dbname,
version, verbose, prompt, logfile, defaults_group_suffix,
defaults_file, login_path, auto_vertical_output, local_infile,
- ssl_ca, ssl_capath, ssl_cert, ssl_key, ssl_cipher,
+ ssl_enable, ssl_ca, ssl_capath, ssl_cert, ssl_key, ssl_cipher,
ssl_verify_server_cert, table, csv, warn, execute, myclirc, dsn,
list_dsn, ssh_user, ssh_host, ssh_port, ssh_password,
ssh_key_filename, list_ssh_config, ssh_config_path, ssh_config_host,
@@ -1203,6 +1205,7 @@ def cli(database, user, host, port, socket, password, dbname,
database = dbname or database
ssl = {
+ 'enable': ssl_enable,
'ca': ssl_ca and os.path.expanduser(ssl_ca),
'cert': ssl_cert and os.path.expanduser(ssl_cert),
'key': ssl_key and os.path.expanduser(ssl_key),