Browse Source

HUE-8336 [hbase] Can't disable certificate verification

Ivan Dzikovsky 7 years ago
parent
commit
b43d23ab69

+ 2 - 1
apps/hbase/src/hbase/api.py

@@ -101,7 +101,8 @@ class HbaseApi(object):
         timeout_seconds=30,
         transport=conf.THRIFT_TRANSPORT.get(),
         transport_mode='http' if is_using_thrift_http() else 'socket',
-        http_url=('https://' if is_using_thrift_ssl() else 'http://') + target['host'] + ':' + str(target['port'])
+        http_url=('https://' if is_using_thrift_ssl() else 'http://') + target['host'] + ':' + str(target['port']),
+        validate=conf.SSL_CERT_CA_VERIFY.get()
     )
 
     return client

+ 8 - 0
apps/hbase/src/hbase/conf.py

@@ -21,6 +21,7 @@ import sys
 
 from django.utils.translation import ugettext_lazy as _t, ugettext as _
 
+from desktop.conf import default_ssl_validate
 from desktop.lib.conf import Config, validate_thrift_transport, coerce_bool
 
 
@@ -64,6 +65,13 @@ USE_DOAS = Config(
   type=coerce_bool
 )
 
+SSL_CERT_CA_VERIFY = Config(
+  key="ssl_cert_ca_verify",
+  help=_t("Choose whether Hue should validate certificates received from the server."),
+  dynamic_default=default_ssl_validate,
+  type=coerce_bool
+)
+
 
 def config_validator(user):
   res = []

+ 3 - 0
desktop/conf.dist/hue.ini

@@ -1262,6 +1262,9 @@
   # 'buffered' used to be the default of the HBase Thrift Server.
   ## thrift_transport=framed
 
+  # Choose whether Hue should validate certificates received from the server.
+  ## ssl_cert_ca_verify=true
+
 
 ###########################################################################
 # Settings to configure Solr Search

+ 3 - 0
desktop/conf/pseudo-distributed.ini.tmpl

@@ -1264,6 +1264,9 @@
   # 'buffered' used to be the default of the HBase Thrift Server.
   ## thrift_transport=framed
 
+  # Choose whether Hue should validate certificates received from the server.
+  ## ssl_cert_ca_verify=true
+
 
 ###########################################################################
 # Settings to configure Solr Search