Kong/kubernetes-ingress-controller
Support multiple Gateway Listener certificateRefs
Open
#2,604 opened on Jun 23, 2022
area/featurearea/gateway-apigood first issuenice-to-havesize/S
Repository metrics
- Stars
- (2,404 stars)
- PR merge metrics
- (PR metrics pending)
Description
A single CertificateRef to a Kubernetes Secret has “Core” support. Implementations MAY choose to support attaching multiple certificates to a Listener, but this behavior is implementation-specific.
#2580 only implements the core requirement, and rejects configurations with multiple certificates.
Kong certificate entities can hold two certificates, and will select the served certificate based on client algorithm support (ECDSA or RSA): https://docs.konghq.com/gateway/latest/admin-api/#add-certificate
Acceptance criteria
To support this for Gateway APIs, we would need to:
- Increase the certificateRef limit to 2.
- If two certificates are present, verify that they use different signature algorithms (Kong will reject them if they do not).
- Verify that all certificates use the same CN and SAN sets. Kong does not require this (it probably should) but the Gateway spec requires that implementations serve the cert with the longest SNI-SAN match (e.g. you would serve the cert with
foo.example.cominstead of*.example.comforfoo.example.com) across all certificates. Since we must instead choose the certificate based on algorithm first, we can't meet that part of the spec and need to instead ensure it's irrelevant. - For Listeners with 2 certificateRefs, create a Kong certificate with one certificate and key in
certandkeyand the other incert_altandkey_alt.