Skip to content

Commit

Permalink
Haproxy config generation fixes for HTTPS protocol
Browse files Browse the repository at this point in the history
Change-Id: I140361ad4785be2a87d23a04181e73ca999e8e2b
Closes-bug: #1466318
  • Loading branch information
anbu-enovance committed Jun 18, 2015
1 parent 67164f6 commit f8da579
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -8,7 +8,7 @@
PROTO_MAP = {
PROTO_TCP: 'tcp',
PROTO_HTTP: 'http',
PROTO_HTTPS: 'tcp'
PROTO_HTTPS: 'http'
}

LB_METHOD_MAP = {
Expand Down Expand Up @@ -71,8 +71,8 @@ def _set_defaults(config):
def _set_frontend(config):
port = config['vip']['port']
ssl = ''
if port == HTTPS_PORT:
ssl = 'ssl crt %s' % ssl_cert_path
if config['vip']['protocol'] == PROTO_HTTPS:
ssl = 'ssl crt %s' % config['ssl-crt']
conf = [
'frontend %s' % config['vip']['id'],
'option tcplog',
Expand All @@ -82,7 +82,8 @@ def _set_frontend(config):
]
if config['vip']['connection-limit'] >= 0:
conf.append('maxconn %s' % config['vip']['connection-limit'])
if config['vip']['protocol'] == PROTO_HTTP:
if config['vip']['protocol'] == PROTO_HTTP or \
config['vip']['protocol'] == PROTO_HTTPS:
conf.append('option forwardfor')
return ("\n\t".join(conf))

Expand Down

0 comments on commit f8da579

Please sign in to comment.