Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TLS handshake on backend #520

Merged
merged 1 commit into from
Feb 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion pkg/haproxy/instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,26 @@ func TestBackends(t *testing.T) {
},
srvsuffix: "ssl verify required ca-file /var/haproxy/ssl/ca.pem crl-file /var/haproxy/ssl/crl.pem",
},
{
doconfig: func(g *hatypes.Global, h *hatypes.Host, b *hatypes.Backend) {
b.Server.Protocol = "h2"
},
srvsuffix: "proto h2",
},
{
doconfig: func(g *hatypes.Global, h *hatypes.Host, b *hatypes.Backend) {
b.Server.Protocol = "h2"
b.Server.Secure = true
},
srvsuffix: "proto h2 alpn h2 ssl verify none",
},
{
doconfig: func(g *hatypes.Global, h *hatypes.Host, b *hatypes.Backend) {
b.Server.Protocol = "h2"
b.Server.Secure = true
b.Server.CAFilename = "/var/haproxy/ssl/ca.pem"
},
srvsuffix: "proto h2 ssl verify required ca-file /var/haproxy/ssl/ca.pem",
srvsuffix: "proto h2 alpn h2 ssl verify required ca-file /var/haproxy/ssl/ca.pem",
},
{
doconfig: func(g *hatypes.Global, h *hatypes.Host, b *hatypes.Backend) {
Expand Down
4 changes: 3 additions & 1 deletion rootfs/etc/haproxy/template/haproxy.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,9 @@ backend {{ $backend.ID }}
{{- define "backend" }}
{{- $backend := .p1 }}
{{- $server := $backend.Server }}
{{- if eq $server.Protocol "h2" }} proto h2{{ end }}
{{- if eq $server.Protocol "h2" }} proto h2
{{- if $server.Secure }} alpn h2{{ end }}
{{- end }}
{{- if $server.MaxConn }} maxconn {{ $server.MaxConn }}{{ end }}
{{- if $server.MaxQueue }} maxqueue {{ $server.MaxQueue }}{{ end }}
{{- if $server.Secure }} ssl
Expand Down