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

Use default certificate only if provided SNI isn't found #700

Merged
merged 1 commit into from
Dec 10, 2020

Conversation

jcmoraisjr
Copy link
Owner

Default or fallback certificate is defined in haproxy declaring it as the first certificate. It should be used in TLS handshakes when SNI is not provided or if the provided one does not have a match.

HAProxy Ingress uses crt-list to better implements Ingress spec: a valid certificate is not one that its CN or SAN has the provided SNI, but instead that one the user declares in the spec.tls hostname.

There is however a scenario which trigger the wrong path: if the default certificate is valid for a provided SNI, haproxy will use it in the handshake instead of a declared certificate - this happens because the default certificate, being the first one, is validated first.

This commit adds a !* in the snifilter of the default certificate. This will instruct haproxy to not add any of its domains - CN and SAN - in the SNI, so it won't match any domain, except if a valid one cannot be found. This is exactly what a default certificate is all about.

#687

Default or fallback certificate is defined in haproxy declaring it as
the first certificate. It should be used in TLS handshakes when SNI is
not provided or if the provided one does not have a match.

HAProxy Ingress uses `crt-list` to better implements Ingress spec: a
valid certificate is not one that its CN or SAN has the provided SNI,
but instead that one the user declares in the spec.tls hostname.

There is however a scenario which trigger the wrong path: if the default
certificate is valid for a provided SNI, haproxy will use it in the
handshake instead of a declared certificate - this happens because the
default certificate, being the first one, is validated first.

This commit adds a `!*` in the snifilter of the default certificate.
This will instruct haproxy to not add any of its domains - CN and SAN -
in the SNI, so it won't match any domain, except if a valid one cannot
be found. This is exactly what a default certificate is all about.
@jcmoraisjr jcmoraisjr merged commit d3c6f8a into master Dec 10, 2020
@jcmoraisjr jcmoraisjr deleted the jm-default-crt branch December 10, 2020 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant