Skip to content
Merged
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
13 changes: 11 additions & 2 deletions test/extended/router/grpc-interop.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,15 @@ var _ = g.Describe("[sig-network-edge][Conformance][Area:Networking][Feature:Rou
pemCrt, err := certgen.MarshalCertToPEMString(tlsCrtData)
o.Expect(err).NotTo(o.HaveOccurred())

_, tlsCrt2Data, tlsPrivateKey2, err := certgen.GenerateKeyPair("Root CA", notBefore, notAfter)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is a new Root CA being generated here? Is tlsCrt2Data intended to be a different root CA or a certificate signed by the first root CA?

Copy link
Contributor Author

@alebedev87 alebedev87 May 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is a new Root CA being generated here?

That's how GenerateKeyPair works. It generates a self signed root CA certificate and then uses it for the test certificate (which we get as second return value).

Is tlsCrt2Data intended to be a different root CA or a certificate signed by the first root CA?

It's intended to be a different certificate. I think that it may still be possible to sign it with the same root CA though. But I stick to what GenerateKeyPair does.

Having different certificates for secure routes instructs router to enable alpn option in crt-list command on HAProxy frontends (e.g. fe_sni). This results into the usage of ALPN TLS extension for the protocol negotiation. Without ALPN, grpc client will refuse to establish a connection to OpenShift router.

o.Expect(err).NotTo(o.HaveOccurred())

pemKey2, err := certgen.MarshalPrivateKeyToPEMString(tlsPrivateKey2)
o.Expect(err).NotTo(o.HaveOccurred())

pemCrt2, err := certgen.MarshalCertToPEMString(tlsCrt2Data)
o.Expect(err).NotTo(o.HaveOccurred())

shardFQDN := oc.Namespace() + "." + defaultDomain

g.By("Creating routes to test for gRPC interoperability")
Expand Down Expand Up @@ -253,8 +262,8 @@ var _ = g.Describe("[sig-network-edge][Conformance][Area:Networking][Feature:Rou
TLS: &routev1.TLSConfig{
Termination: routev1.TLSTerminationReencrypt,
InsecureEdgeTerminationPolicy: routev1.InsecureEdgeTerminationPolicyRedirect,
Key: pemKey,
Certificate: pemCrt,
Key: pemKey2,
Certificate: pemCrt2,
},
To: routev1.RouteTargetReference{
Kind: "Service",
Expand Down