envoyconfig: add virtual host domains for certificates in addition to routes #3593
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Currently we only add domains to the envoy config based on routes. This means if we have a route
from.example.com
and a wildcard certificate*.example.com
, that certificate will only be served to requests fromfrom.example.com
. Sounknown.example.com
would end up receiving a self-signed certificate. This PR updates the code to also add the*.example.com
as a handled domain. This domain will have no routes attached to it, but it will serve the proper certificate, so the user would no longer receive a self-signed certificate.Unlike route matching envoy matches filter chains based on most specific to least specific. So if there is a filter chain for
*.example.com
and another one forfrom.example.com
, if a request comes in forfrom.example.com
it will be sent to that filter chain regardless of the ordering of the filter chains. (so it's ok if*.example.com
occurs first in the list)Related issues
Fixes #3577
Checklist
improvement
/bug
/ etc)