-
Notifications
You must be signed in to change notification settings - Fork 687
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
SNI certificates not functioning as expected #1792
Comments
I am seeing the same, however I just noticed if I disable the tls module so that I do not get redirect_cleartext_from it appears to work properly using a non-wildcard TLSContext. |
This issue is happening for me as well. I am trying to serve three distinct domains using ambassador v0.76.0. ---
apiVersion: getambassador.io/v1
kind: TLSContext
name: aoc-tls
hosts:
- "api.realdomain.com"
secret: aoc-cert
ambassador_id: {{ $ambassadorId }}
min_tls_version: v1.2
max_tls_version: v1.3
alpn_protocols: h2[, http/1.1]
---
apiVersion: getambassador.io/v1
kind: TLSContext
name: short-tls
hosts:
- "domain.pub"
secret: short-cert
ambassador_id: {{ $ambassadorId }}
min_tls_version: v1.2
max_tls_version: v1.3
alpn_protocols: h2[, http/1.1]
---
apiVersion: getambassador.io/v1
kind: TLSContext
name: aoc-tls-old
hosts:
- "api.olddomain.com"
secret: aoc-tls-old
ambassador_id: {{ $ambassadorId }}
min_tls_version: v1.2
max_tls_version: v1.3
alpn_protocols: h2[, http/1.1]
---
apiVersion: getambassador.io/v1
kind: Module
name: tls
ambassador_id: {{ $ambassadorId }}
config:
server:
redirect_cleartext_from: 8080 the "ambassador-secret" cert in the namespace is for Any calls for But I try to call something in |
After playing with a bunch of different things today I decided to move to an NLB over the classic ELB and everything appears to be working now, including a default selfsigned cert for all hosts, and then per domain real certificates and even cleartext redirection. |
So this is a bug around SNI and
or in more lay terms, make things like SNI + (Note also that I'm not too concerned about breaking people currently using glob patterns in the |
I'm not using host_regex. Some more info: I have three domains: I have certificates for each of these domains: Here is my annotation on my ambassador service: metadata:
annotations:
getambassador.io/config: |
---
apiVersion: getambassador.io/v1
kind: Module
name: ambassador
ambassador_id: analytics-qa
config:
service_port: 8443
diagnostics:
enabled: true
cors:
origins: '*'
methods: 'GET, POST, DELETE, PUT, OPTIONS'
headers:
- authorization
- content-type
exposed_headers: ''
max_age: '1728000'
load_balancer:
policy: ring_hash
source_ip: true
---
apiVersion: getambassador.io/v1
kind: TLSContext
name: aoc-tls
hosts:
- "api.qa.realdomain.com"
secret: a1-cert
ambassador_id: analytics-qa
min_tls_version: v1.2
max_tls_version: v1.3
alpn_protocols: h2[, http/1.1]
---
apiVersion: getambassador.io/v1
kind: TLSContext
name: short-tls
hosts:
- "domain.pub"
secret: short-cert
ambassador_id: analytics-qa
min_tls_version: v1.2
max_tls_version: v1.3
alpn_protocols: h2[, http/1.1]
---
apiVersion: getambassador.io/v1
kind: TLSContext
name: files-tls
hosts:
- "api.qa.olddomain.com"
secret: files-cert
ambassador_id: analytics-qa
min_tls_version: v1.2
max_tls_version: v1.3
alpn_protocols: h2[, http/1.1]
---
apiVersion: getambassador.io/v1
kind: Module
name: tls
ambassador_id: analytics-qa
config:
server:
redirect_cleartext_from: 8080 Here are the mappings I have for "api.realdomain.com" and "api.olddomain.com" metadata:
annotations:
getambassador.io/config: |
---
apiVersion: ambassador/v1
kind: Mapping
name: analytics-qa-f4-back-end-puma-mapping-0
prefix: /
host: api.qa.realdomain.com
service: analytics-qa-f4-back-end-puma.analytics-qa
rewrite: ""
ambassador_id: analytics-qa
tls: aoc-tls
bypass_auth: true
timeout_ms: 90000
---
apiVersion: ambassador/v1
kind: Mapping
name: analytics-qa-f4-back-end-puma-mapping-1
prefix: /
host: api.qa.olddomain.com
service: analytics-qa-f4-back-end-puma.analytics-qa
rewrite: ""
ambassador_id: analytics-qa
tls: files-tls
bypass_auth: true
timeout_ms: 90000 here is my mapping for "domain.pub" metadata:
annotations:
getambassador.io/config: |
---
apiVersion: ambassador/v1
kind: Mapping
name: analytics-qa-f4-back-end-short-f4-back-end-short-mapping-0
prefix: /
service: http://analytics-qa-f4-back-end-short.analytics-qa
rewrite: ""
host: domain.pub
ambassador_id: analytics-qa
bypass_auth: true If I look in the admin view it looks like like everything is good to go: {
"match": {
"case_sensitive": true,
"headers": [
{
"exact_match": "api.qa.olddomain.com",
"name": ":authority"
}
],
"prefix": "/",
"runtime_fraction": {
"default_value": {
"denominator": "HUNDRED",
"numerator": 100
},
"runtime_key": "routing.traffic_shift.cluster_analytics_qa_f4_back_end_puma_an-1"
}
},
"per_filter_config": {
"envoy.ext_authz": {
"disabled": true
}
},
"route": {
"cluster": "cluster_analytics_qa_f4_back_end_puma_an-1",
"cors": {
"allow_headers": "authorization, content-type",
"allow_methods": "GET, POST, DELETE, PUT, OPTIONS",
"allow_origin": [
"*"
],
"enabled": true,
"max_age": "1728000"
},
"hash_policy": [
{
"connection_properties": {
"source_ip": true
}
}
],
"priority": null,
"timeout": "90.000s"
}
} {
"match": {
"case_sensitive": true,
"headers": [
{
"exact_match": "api.qa.realdomain.com",
"name": ":authority"
}
],
"prefix": "/",
"runtime_fraction": {
"default_value": {
"denominator": "HUNDRED",
"numerator": 100
},
"runtime_key": "routing.traffic_shift.cluster_analytics_qa_f4_back_end_puma_an-0"
}
},
"per_filter_config": {
"envoy.ext_authz": {
"disabled": true
}
},
"route": {
"cluster": "cluster_analytics_qa_f4_back_end_puma_an-0",
"cors": {
"allow_headers": "authorization, content-type",
"allow_methods": "GET, POST, DELETE, PUT, OPTIONS",
"allow_origin": [
"*"
],
"enabled": true,
"max_age": "1728000"
},
"hash_policy": [
{
"connection_properties": {
"source_ip": true
}
}
],
"priority": null,
"timeout": "90.000s"
}
} {
"match": {
"case_sensitive": true,
"headers": [
{
"exact_match": "domain.pub",
"name": ":authority"
}
],
"prefix": "/",
"runtime_fraction": {
"default_value": {
"denominator": "HUNDRED",
"numerator": 100
},
"runtime_key": "routing.traffic_shift.cluster_http___analytics_qa_f4_back_end_-0"
}
},
"per_filter_config": {
"envoy.ext_authz": {
"disabled": true
}
},
"route": {
"cluster": "cluster_http___analytics_qa_f4_back_end_-0",
"cors": {
"allow_headers": "authorization, content-type",
"allow_methods": "GET, POST, DELETE, PUT, OPTIONS",
"allow_origin": [
"*"
],
"enabled": true,
"max_age": "1728000"
},
"hash_policy": [
{
"connection_properties": {
"source_ip": true
}
}
],
"priority": null,
"timeout": "3.000s"
}
} but routing just doesn't seem to work at all
logs aren't helpful
|
Really, it seems that routing doesn't work at all if you define a service to use a specific host, all my routes that don't have a host defined work as expect, all my routes that do have it defined, do not |
We think we're running into this issue envoyproxy/envoy#3411, because ambassador renders an envoy.json with an empty
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Any updates on this? It's still happening. |
Describe the bug
Currently working with @kflynn on this issue via Slack. Defining TLS certificates using TLSContext does not seem to be working correctly.
To Reproduce
Steps to reproduce the behavior:
I removed any trace of the default 'ambassador-certs' secret
I set up a TLSContext as follows,
I set up a mapping as follows,
I have the tls module also set up in it's most basic form to provide HTTP>HTTPS redirection as follows,
We are also running an AuthService and Tracing module, however I have disabled these to aid the fault finding.
Expected behavior
I would expect the certificate to be served by Ambassador however this does not happen. In Chrome I see a ERR_CONNECTION_RESET and from the OpenSSL command line I see the following,
If I change the TLSContext to use a wildcard. Everything is fine, but obviously I can only serve a single certificate.
Versions (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: