Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/api/getambassador.io/v2/crd_tlscontext.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type TLSContextSpec struct {
SecretNamespacing *bool `json:"secret_namespacing,omitempty"`
RedirectCleartextFrom *int `json:"redirect_cleartext_from,omitempty"`
SNI string `json:"sni,omitempty"`
VerifyUpstreamCerts *bool `json:"verify_upstream_certs,omitempty"`

// +k8s:conversion-gen:rename=CRLSecret
V3CRLSecret string `json:"v3CRLSecret,omitempty"`
Expand Down
10 changes: 9 additions & 1 deletion python/ambassador/envoy/v3/v3tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,15 @@ def update_validation(self, key: str, value: str) -> None:
EnvoyValidationContext,
self.get_common().setdefault("validation_context", empty_context),
)

src: EnvoyCoreSource = {"filename": value}

# Create the 'match_subject_alt_names' dictionary if it doesn't exist
match_san = validation.setdefault("match_subject_alt_names", {})

# Create the SAN type (e.g., DNS) dictionary if it doesn't exist
san_type_dict = match_san.setdefault(san_type, [])
san_type_dict.append(src)

validation[key] = src

def add_context(self, ctx: IRTLSContext) -> None:
Expand All @@ -142,6 +149,7 @@ def add_context(self, ctx: IRTLSContext) -> None:
("min_tls_version", self.update_tls_version, "tls_minimum_protocol_version"),
("max_tls_version", self.update_tls_version, "tls_maximum_protocol_version"),
("sni", self.__setitem__, "sni"),
("verify_upstream_certs", self.__setitem__, "verify_upstream_certs")
]:
value = ctx.get(ctxkey, None)

Expand Down
4 changes: 4 additions & 0 deletions python/ambassador/ir/irtlscontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class IRTLSContext(IRResource):
"redirect_cleartext_from",
"secret_namespacing",
"sni",
"verify_upstream_certs",
}

AllowedTLSVersions = ["v1.0", "v1.1", "v1.2", "v1.3"]
Expand Down Expand Up @@ -105,6 +106,9 @@ def setup(self, ir: "IR", aconf: Config) -> bool:
if not self.get("_ambassador_enabled", False):
spec_count = 0
errors = 0
if self.get("verify_upstream_certs", False):
spec_count += 1


if self.get("secret", None):
spec_count += 1
Expand Down