Skip to content

Commit 4a150bf

Browse files
authored
Specify SAN validation precedence over Hostname validation (#4039)
1 parent 477155d commit 4a150bf

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

apis/v1alpha3/backendtlspolicy_types.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,11 @@ type BackendTLSPolicyValidation struct {
201201
// backends:
202202
//
203203
// 1. Hostname MUST be used as the SNI to connect to the backend (RFC 6066).
204-
// 2. Hostname MUST be used for authentication and MUST match the certificate served by the matching backend, unless SubjectAltNames is specified.
204+
// 2. Hostname MUST be used for authentication and MUST match the certificate
205+
// served by the matching backend, unless SubjectAltNames is specified.
206+
// 3. If SubjectAltNames are specified, Hostname can be used for certificate selection
207+
// but MUST NOT be used for authentication. If you want to use the value
208+
// of the Hostname field for authentication, you MUST add it to the SubjectAltNames list.
205209
//
206210
// Support: Core
207211
//

config/crd/experimental/gateway.networking.k8s.io_backendtlspolicies.yaml

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

geps/gep-3155/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ type BackendTLSPolicyValidation struct {
9999
// SubjectAltNames contains one or more Subject Alternative Names.
100100
// When specified, the certificate served from the backend MUST have at least one
101101
// Subject Alternate Name matching one of the specified SubjectAltNames.
102+
// If SubjectAltNames are specified, Hostname MUST NOT be used for authentication,
103+
// even if this would cause a failure in the case that the SubjectAltNames do not match.
104+
// If you want to use Hostname for authentication, you must add Hostname to the SubjectAltNames list.
105+
//
102106
// +kubebuilder:validation:MaxItems=5
103107
SubjectAltNames []SubjectAltName `json:"subjectAltNames,omitempty"`
104108
}

pkg/generated/openapi/zz_generated.openapi.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)