Enforce strict-sni instead of default certificate fallback - #621
Draft
Thanhphan1147 with Copilot wants to merge 6 commits into
Draft
Enforce strict-sni instead of default certificate fallback#621Thanhphan1147 with Copilot wants to merge 6 commits into
Thanhphan1147 with Copilot wants to merge 6 commits into
Conversation
Co-authored-by: Thanhphan1147 <42444001+Thanhphan1147@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Enhance connection handling by using strict-sni
Enforce strict-sni instead of default certificate fallback
Aug 11, 2026
Thanhphan1147
marked this pull request as ready for review
August 11, 2026 17:23
swetha1654
reviewed
Aug 12, 2026
swetha1654
left a comment
Contributor
There was a problem hiding this comment.
Would this be a breaking change?
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens TLS behavior for all SSL frontends generated by the charm by enabling HAProxy’s strict-sni globally, preventing fallback to a default certificate when SNI is missing or does not match a configured certificate.
Changes:
- Enabled
strict-sniin globalssl-default-bind-optionsin the HAProxy config template. - Added a release-notes change artifact documenting the behavior change.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| haproxy-operator/templates/haproxy.cfg.j2 | Adds strict-sni to global bind SSL options to enforce SNI/cert matching. |
| docs/release-notes/artifacts/pr0621.yaml | Release note entry describing the new strict SNI TLS behavior. |
Suppressed comments (1)
docs/release-notes/artifacts/pr0621.yaml:10
strict-snialso rejects TLS handshakes that do not include SNI at all, not just those with an unmatched SNI. The release note currently omits the no-SNI behavior, which is part of the breaking change users need to be aware of.
description: >
Added `strict-sni` to the global `ssl-default-bind-options` so HAProxy
rejects TLS connections whose SNI does not match any configured
certificate instead of falling back to a default certificate.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Thanhphan1147
marked this pull request as draft
August 13, 2026 09:56
Collaborator
|
Moving this to draft to evaluate backwards compatibility |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this PR does
Adds
strict-snito the globalssl-default-bind-optionsintemplates/haproxy.cfg.j2. HAProxy now rejects TLS handshakes whose SNI matches no configured certificate instead of silently serving a default certificate. Applies to every SSL frontend (ingress, ingress-per-unit, haproxy-route, gRPC, TCP terminate).reference docs: https://www.haproxy.com/documentation/haproxy-configuration-manual/latest/#5.1-strict-sni
Why we need it
Falling back to a default certificate masks misconfiguration and serves the wrong cert for unknown hostnames.
strict-snifails the connection instead, surfacing the mismatch.Review focus: clients that connect without SNI (or with an unmatched SNI) will now be rejected at the TLS layer. Set globally rather than per-
bindto cover all frontends with one option.Potential breaking change: existing non-SNI TLS clients targeting these frontends will start failing the handshake.
Checklist
docs/changelog.mdwith user-relevant changesdocs/release-notes/artifacts. If no change artifact is necessary, I tagged the PR with the labelno-release-note.(e.g., in
.github/workflows/integration_tests.yaml, ensure themoduleslist is correct)terraform fmtpasses andtflintreports no errors