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

Add SNI skip for client node configuration #2013

Merged
merged 2 commits into from
Mar 14, 2023
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
3 changes: 3 additions & 0 deletions .changelog/2013.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
api-gateway: fix issue where specifying an external server SNI name while using client nodes resulted in a TLS verification error.
```
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ spec:
{{- end }}
- name: CONSUL_HTTP_SSL
value: "{{ .Values.global.tls.enabled }}"
{{- if and .Values.externalServers.enabled .Values.externalServers.tlsServerName }}
{{- if and (not .Values.client.enabled) .Values.externalServers.enabled .Values.externalServers.tlsServerName }}
- name: CONSUL_TLS_SERVER_NAME
value: {{ .Values.externalServers.tlsServerName }}
{{- end }}
Expand Down
18 changes: 18 additions & 0 deletions charts/consul/test/unit/api-gateway-controller-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,24 @@ load _helpers
[ "${actual}" = "true" ]
}

@test "apiGateway/Deployment: CONSUL_TLS_SERVER_NAME will not be set for when clients are used" {
cd `chart_dir`
local actual=$(helm template \
-s templates/api-gateway-controller-deployment.yaml \
--set 'apiGateway.enabled=true' \
--set 'apiGateway.image=bar' \
--set 'global.tls.enabled=true' \
--set 'externalServers.enabled=true' \
--set 'externalServers.hosts[0]=external-consul.host' \
--set 'externalServers.httpsPort=8501' \
--set 'externalServers.tlsServerName=hashi' \
--set 'client.enabled=true' \
--set 'server.enabled=false' \
. | tee /dev/stderr |
yq '.spec.template.spec.containers[] | select (.name == "api-gateway-controller") | .env[] | select(.name == "CONSUL_TLS_SERVER_NAME")' | tee /dev/stderr)
[ "${actual}" = "" ]
}

#--------------------------------------------------------------------
# Admin Partitions

Expand Down