Browse Source

[HUE-6243] Fix Hue Load Balancer SSL Handshake error

Customers that use httpd 2.4 version as a load balancer, with SSL protocol between LB and multiple Hue servers, will encounter the SSL handshake issue during handshake between LB & Hue. The issue can be resolved with CM and this Hue side change.

Testing Done:
- Tested on CDEP Cluster
- Checked Hue works out of box
- Checked Host Name gets logged in

(cherry picked from commit 309e75dbb611cfac73f11161ad5cd5ba09a18fdc)
Prakash Ranade 8 years ago
parent
commit
b641361

+ 1 - 1
desktop/conf.dist/hue.ini

@@ -145,7 +145,7 @@
   ## http_x_frame_options=SAMEORIGIN
 
   # Enable X-Forwarded-Host header if the load balancer requires it.
-  ## use_x_forwarded_host=false
+  ## use_x_forwarded_host=true
 
   # Support for HTTPS termination at the load-balancer level with SECURE_PROXY_SSL_HEADER.
   ## secure_proxy_ssl_header=false

+ 1 - 1
desktop/conf/pseudo-distributed.ini.tmpl

@@ -149,7 +149,7 @@
   ## http_x_frame_options=SAMEORIGIN
 
   # Enable X-Forwarded-Host header if the load balancer requires it.
-  ## use_x_forwarded_host=false
+  ## use_x_forwarded_host=true
 
   # Support for HTTPS termination at the load-balancer level with SECURE_PROXY_SSL_HEADER.
   ## secure_proxy_ssl_header=false

+ 5 - 1
desktop/core/src/desktop/conf.py

@@ -100,6 +100,10 @@ def coerce_positive_integer(integer):
 
   return integer
 
+def is_lb_enabled():
+  """Check for Hue Load Balancer is available"""
+  return bool(HUE_LOAD_BALANCER.get())
+
 def coerce_zero_or_positive_integer(integer):
   integer = int(integer)
 
@@ -400,7 +404,7 @@ USE_X_FORWARDED_HOST = Config(
   key="use_x_forwarded_host",
   help=_("Enable X-Forwarded-Host header if the load balancer requires it."),
   type=coerce_bool,
-  default=False)
+  dynamic_default=is_lb_enabled)
 
 SECURE_PROXY_SSL_HEADER = Config(
   key="secure_proxy_ssl_header",