Skip to content

Commit 995297a

Browse files
JimvinPhilip Langdale
authored and
Philip Langdale
committed
Added TLS support for cm_shell
There is now a new command line option [-t|-tls] that will enable TLS for the connection to the Cloudera API. Note that enabling TLS will not automatically change the port the client connects to CM on, so -p 7183 (default CM TLS port) needs to be added to the command line for the connection to succeed. jims-air:cm_shell jhalfpenny$ ./cmps.py -H test-cluster.cloudera.com -p 7183 -t Enter Username: admin Enter Password: Welcome to the Cloudera Manager Console Select a cluster using 'show clusters' and 'use' cloudera>
1 parent 6100a03 commit 995297a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

python/src/cm_shell/cmps.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ def main():
593593
parser.add_argument('--password', action='store', dest='password')
594594
parser.add_argument('-e', '--execute', action='store', dest='execute')
595595
parser.add_argument('-s', '--seperator', action='store', dest='seperator')
596+
parser.add_argument('-t', '--tls', action='store_const', dest='use_tls', const=True, default=False)
596597
args = parser.parse_args()
597598

598599
# Check if a username was suplied, if not, prompt the user
@@ -605,12 +606,12 @@ def main():
605606

606607
# Attempt to authenticate using the API
607608
global api
608-
api = ApiResource(args.hostname, args.port, args.username, args.password)
609+
api = ApiResource(args.hostname, args.port, args.username, args.password, args.use_tls)
609610
try:
610611
api.echo("ping")
611612
except ApiException:
612613
try:
613-
api = ApiResource(args.hostname, args.port, args.username, args.password, version=1)
614+
api = ApiResource(args.hostname, args.port, args.username, args.password, args.use_tls, version=1)
614615
api.echo("ping")
615616
except ApiException:
616617
print("Unable to Authenticate")

0 commit comments

Comments
 (0)