IMPALA-8595: Support TLSv1.2 with Python < 2.7.9 in shell

IMPALA-5690 replaced thrift 0.9.0 with 0.9.3 in which THRIFT-3505
changed transport/TSSLSocket.py.
In thrift 0.9.3, if the python version is lower than 2.7.9, TSSLSocket
uses PROTOCOL_TLSv1 by default and the SSL version is passed to
TSSLSocket as a paramter when calling TSSLSocket.__init__.
Although TLSv1.2 is supported by Python from 2.7.9, Red Hat/CentOS
support TLSv1.2 from 2.7.5 with upgraded python-libs. We need to get
impala-shell support TLSv1.2 with Python 2.7.5 on Red Hat/CentOS.

TESTING:
impala-py.test tests/custom_cluster/test_client_ssl.py

Change-Id: I3fb6510f4b556bd8c6b1e86380379aba8be4b805
Reviewed-on: http://gerrit.cloudera.org:8080/13457
Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
Robbie Zhang
2019-05-29 06:22:26 -07:00
committed by Impala Public Jenkins
parent 24b7a3bf56
commit d5673bf241
3 changed files with 20 additions and 4 deletions

View File

@@ -20,6 +20,7 @@ import logging
import os
import re
import requests
import platform
LOG = logging.getLogger('tests.common.environ')
test_start_cluster_args = os.environ.get("TEST_START_CLUSTER_ARGS", "")
@@ -41,6 +42,13 @@ if os.path.isfile(IMPALA_LOCAL_VERSION_INFO):
if IMPALA_LOCAL_BUILD_VERSION is None:
raise Exception("Could not find VERSION in {0}".format(IMPALA_LOCAL_VERSION_INFO))
# Check if it is Red Hat/CentOS Linux
dist = platform.linux_distribution()[0].lower()
if dist.find('centos') or dist.find('red hat'):
IS_REDHAT_DERIVATIVE = True
else:
IS_REDHAT_DERIVATIVE = False
# Find the likely BuildType of the running Impala. Assume it's found through the path
# $IMPALA_HOME/be/build/latest as a fallback.
build_type_arg_regex = re.compile(r'--build_type=(\w+)', re.I)