Merge "Fix unquoted string"
diff --git a/.travis.yml b/.travis.yml
index e607c9a..22259c4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,7 +15,8 @@
     gem 'test-kitchen'
     gem 'kitchen-docker'
     gem 'kitchen-inspec'
-    gem 'inspec'
+    gem 'inspec', '<3.0.0'
+    #Version was frozen, because of issues in the version of inspec >3.0.0 -- see https://mirantis.jira.com/browse/PROD-24324 for more info
     gem 'kitchen-salt', :git => 'https://github.com/salt-formulas/kitchen-salt.git'
   - bundle install
 
diff --git a/horizon/files/enabled/horizon_override.py b/horizon/files/enabled/horizon_override.py
index 28ac6e5..6385e3c 100644
--- a/horizon/files/enabled/horizon_override.py
+++ b/horizon/files/enabled/horizon_override.py
@@ -3,14 +3,6 @@
 
 ALLOWED_HOSTS = ['*']
 
-{%- if app.ssl is defined %}
-{%- if app.ssl.enabled %}
-SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
-CSRF_COOKIE_SECURE = True
-SESSION_COOKIE_SECURE = True
-{%- endif %}
-{%- endif %}
-
 SECRET_KEY = '{{ app.secret_key }}'
 
 {% include "horizon/files/local_settings/_keystone_settings.py" %}
diff --git a/horizon/files/horizon_settings/_local_settings.py b/horizon/files/horizon_settings/_local_settings.py
index aa2f9a8..59fc1d2 100644
--- a/horizon/files/horizon_settings/_local_settings.py
+++ b/horizon/files/horizon_settings/_local_settings.py
@@ -12,14 +12,6 @@
 
 ALLOWED_HOSTS = ['*']
 
-{%- if app.ssl is defined %}
-{%- if app.ssl.enabled %}
-SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
-CSRF_COOKIE_SECURE = True
-SESSION_COOKIE_SECURE = True
-{%- endif %}
-{%- endif %}
-
 AUTHENTICATION_URLS = ['openstack_auth.urls']
 
 LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
diff --git a/horizon/files/horizon_settings/_ssl_settings.py b/horizon/files/horizon_settings/_ssl_settings.py
index c5e03de..77bcb8b 100644
--- a/horizon/files/horizon_settings/_ssl_settings.py
+++ b/horizon/files/horizon_settings/_ssl_settings.py
@@ -1,11 +1,14 @@
+{%- if server.app is defined %}
+{%- set app = salt['pillar.get']('horizon:server:app:'+app_name) %}
+{%- else %}
+{%- set app = salt['pillar.get']('horizon:server') %}
+{%- endif %}
 
-{%- from "horizon/map.jinja" import server with context %}
-
-{%- if server.get('secure', True) %}
+{%- if app.get('secure', True) or app.get('ssl', {}).get('enabled') %}
 
 USE_SSL = True
+SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
 CSRF_COOKIE_SECURE = True
-CSRF_COOKIE_SECURE = True
-SESSION_COOKIE_HTTPONLY = True
+SESSION_COOKIE_SECURE = True
 
-{%- endif %}
\ No newline at end of file
+{%- endif %}