Merge ~hloeung/content-cache-charm:http2 into content-cache-charm:master

Proposed by Haw Loeung
Status: Merged
Approved by: Haw Loeung
Approved revision: 1192f964ebcbe6440cb1663c8b437d88cc28cd8c
Merged at revision: 46f37df80eb74980e5e64dcafd33030bb768b2bf
Proposed branch: ~hloeung/content-cache-charm:http2
Merge into: content-cache-charm:master
Diff against target: 109 lines (+19/-17)
5 files modified
lib/haproxy.py (+3/-1)
tests/unit/files/content_cache_rendered_haproxy_test_output.txt (+4/-4)
tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt (+4/-4)
tests/unit/files/haproxy_config_rendered_listen_stanzas_test_output.txt (+4/-4)
tests/unit/files/haproxy_config_rendered_test_output.txt (+4/-4)
Reviewer Review Type Date Requested Status
Joel Sing (community) +1 Approve
Canonical IS Reviewers Pending
Review via email: mp+381207@code.launchpad.net

Commit message

Add HTTP/2 support via the TLS ALPN extension

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Joel Sing (jsing) wrote :

LGTM, but see comment.

review: Approve (+1)
Revision history for this message
Haw Loeung (hloeung) :
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 46f37df80eb74980e5e64dcafd33030bb768b2bf

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/haproxy.py b/lib/haproxy.py
2index b8d8727..d2e3f5b 100644
3--- a/lib/haproxy.py
4+++ b/lib/haproxy.py
5@@ -139,7 +139,9 @@ listen {name}
6 tls_config = ''
7 if tls_cert_bundle_paths:
8 paths = sorted(set(tls_cert_bundle_paths))
9- tls_config = ' ssl {}'.format(' '.join(['crt {}'.format(path) for path in paths]))
10+ certs = ' '.join(['crt {}'.format(path) for path in paths])
11+ alpn_protos = 'h2,http/1.1'
12+ tls_config = ' ssl {} alpn {}'.format(certs, alpn_protos)
13
14 if len(backend_config) == 1:
15 backend_config = ['{indent}default_backend backend-{backend}\n'.format(backend=name, indent=INDENT)]
16diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output.txt
17index fddd98a..81f5fab 100644
18--- a/tests/unit/files/content_cache_rendered_haproxy_test_output.txt
19+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output.txt
20@@ -79,8 +79,8 @@ listen site1-local
21 default_backend backend-site1-local
22
23 listen cached-site2-local
24- bind 0.0.0.0:443 ssl crt /etc/haproxy/site2-bundle.crt
25- bind :::443 ssl crt /etc/haproxy/site2-bundle.crt
26+ bind 0.0.0.0:443 ssl crt /etc/haproxy/site2-bundle.crt alpn h2,http/1.1
27+ bind :::443 ssl crt /etc/haproxy/site2-bundle.crt alpn h2,http/1.1
28 default_backend backend-cached-site2-local
29
30 listen site2-local
31@@ -104,8 +104,8 @@ listen site6-local
32 default_backend backend-site6-local
33
34 listen combined-444
35- bind 0.0.0.0:444 ssl crt /etc/haproxy/site7-bundle.crt crt /etc/haproxy/site8-bundle.crt
36- bind :::444 ssl crt /etc/haproxy/site7-bundle.crt crt /etc/haproxy/site8-bundle.crt
37+ bind 0.0.0.0:444 ssl crt /etc/haproxy/site7-bundle.crt crt /etc/haproxy/site8-bundle.crt alpn h2,http/1.1
38+ bind :::444 ssl crt /etc/haproxy/site7-bundle.crt crt /etc/haproxy/site8-bundle.crt alpn h2,http/1.1
39 use_backend backend-cached-site7-local if { hdr(Host) -i site7.local }
40 use_backend backend-cached-site8-local if { hdr(Host) -i site8.local }
41
42diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt
43index f7ad762..4a1fb68 100644
44--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt
45+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt
46@@ -79,8 +79,8 @@ listen site1-local
47 default_backend backend-site1-local
48
49 listen cached-site2-local
50- bind 0.0.0.0:443 ssl crt /etc/haproxy/site2-bundle.crt
51- bind :::443 ssl crt /etc/haproxy/site2-bundle.crt
52+ bind 0.0.0.0:443 ssl crt /etc/haproxy/site2-bundle.crt alpn h2,http/1.1
53+ bind :::443 ssl crt /etc/haproxy/site2-bundle.crt alpn h2,http/1.1
54 default_backend backend-cached-site2-local
55
56 listen site2-local
57@@ -104,8 +104,8 @@ listen site6-local
58 default_backend backend-site6-local
59
60 listen combined-444
61- bind 0.0.0.0:444 ssl crt /etc/haproxy/site7-bundle.crt crt /etc/haproxy/site8-bundle.crt
62- bind :::444 ssl crt /etc/haproxy/site7-bundle.crt crt /etc/haproxy/site8-bundle.crt
63+ bind 0.0.0.0:444 ssl crt /etc/haproxy/site7-bundle.crt crt /etc/haproxy/site8-bundle.crt alpn h2,http/1.1
64+ bind :::444 ssl crt /etc/haproxy/site7-bundle.crt crt /etc/haproxy/site8-bundle.crt alpn h2,http/1.1
65 use_backend backend-cached-site7-local if { hdr(Host) -i site7.local }
66 use_backend backend-cached-site8-local if { hdr(Host) -i site8.local }
67
68diff --git a/tests/unit/files/haproxy_config_rendered_listen_stanzas_test_output.txt b/tests/unit/files/haproxy_config_rendered_listen_stanzas_test_output.txt
69index e98c5fe..c86468b 100644
70--- a/tests/unit/files/haproxy_config_rendered_listen_stanzas_test_output.txt
71+++ b/tests/unit/files/haproxy_config_rendered_listen_stanzas_test_output.txt
72@@ -11,12 +11,12 @@ listen combined-80
73 use_backend backend-site9-local if { hdr(Host) -i site9.local }
74
75 listen site2-local
76- bind 0.0.0.0:443 ssl crt /etc/haproxy/site2-bundle.crt
77- bind :::443 ssl crt /etc/haproxy/site2-bundle.crt
78+ bind 0.0.0.0:443 ssl crt /etc/haproxy/site2-bundle.crt alpn h2,http/1.1
79+ bind :::443 ssl crt /etc/haproxy/site2-bundle.crt alpn h2,http/1.1
80 default_backend backend-site2-local
81
82 listen combined-444
83- bind 0.0.0.0:444 ssl crt /etc/haproxy/site7-bundle.crt crt /etc/haproxy/site8-bundle.crt
84- bind :::444 ssl crt /etc/haproxy/site7-bundle.crt crt /etc/haproxy/site8-bundle.crt
85+ bind 0.0.0.0:444 ssl crt /etc/haproxy/site7-bundle.crt crt /etc/haproxy/site8-bundle.crt alpn h2,http/1.1
86+ bind :::444 ssl crt /etc/haproxy/site7-bundle.crt crt /etc/haproxy/site8-bundle.crt alpn h2,http/1.1
87 use_backend backend-site7-local if { hdr(Host) -i site7.local }
88 use_backend backend-site8-local if { hdr(Host) -i site8.local }
89diff --git a/tests/unit/files/haproxy_config_rendered_test_output.txt b/tests/unit/files/haproxy_config_rendered_test_output.txt
90index f62e67a..142765d 100644
91--- a/tests/unit/files/haproxy_config_rendered_test_output.txt
92+++ b/tests/unit/files/haproxy_config_rendered_test_output.txt
93@@ -75,13 +75,13 @@ listen combined-80
94 use_backend backend-site9-local if { hdr(Host) -i site9.local }
95
96 listen site2-local
97- bind 0.0.0.0:443 ssl crt /etc/haproxy/site2-bundle.crt
98- bind :::443 ssl crt /etc/haproxy/site2-bundle.crt
99+ bind 0.0.0.0:443 ssl crt /etc/haproxy/site2-bundle.crt alpn h2,http/1.1
100+ bind :::443 ssl crt /etc/haproxy/site2-bundle.crt alpn h2,http/1.1
101 default_backend backend-site2-local
102
103 listen combined-444
104- bind 0.0.0.0:444 ssl crt /etc/haproxy/site7-bundle.crt crt /etc/haproxy/site8-bundle.crt
105- bind :::444 ssl crt /etc/haproxy/site7-bundle.crt crt /etc/haproxy/site8-bundle.crt
106+ bind 0.0.0.0:444 ssl crt /etc/haproxy/site7-bundle.crt crt /etc/haproxy/site8-bundle.crt alpn h2,http/1.1
107+ bind :::444 ssl crt /etc/haproxy/site7-bundle.crt crt /etc/haproxy/site8-bundle.crt alpn h2,http/1.1
108 use_backend backend-site7-local if { hdr(Host) -i site7.local }
109 use_backend backend-site8-local if { hdr(Host) -i site8.local }
110

Subscribers

People subscribed via source and target branches