File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -560,14 +560,16 @@ func (r *RouteController) populateRoute(ctx context.Context, route *routev1.Rout
560560 // final Sanity checks
561561 var key crypto.Signer
562562
563- // get private key and signed certificate from Secret
563+ // get private key, signed certificate and ca chain certficates from Secret
564564 k , err := utilpki .DecodePrivateKeyBytes (secret .Data ["tls.key" ])
565565 if err != nil {
566566 return err
567567 }
568568 key = k
569569
570- certificate , err := utilpki .DecodeX509CertificateBytes (secret .Data ["tls.crt" ])
570+ certificates , err := utilpki .DecodeX509CertificateSetBytes (secret .Data ["tls.crt" ])
571+
572+ certificate := certificates [0 ]
571573 if err != nil {
572574 return err
573575 }
@@ -596,6 +598,12 @@ func (r *RouteController) populateRoute(ctx context.Context, route *routev1.Rout
596598 }
597599 route .Spec .TLS .Certificate = string (encodedCert )
598600
601+ encodedCAs , err := utilpki .EncodeX509Chain (certificates [1 :])
602+ if err != nil {
603+ return err
604+ }
605+ route .Spec .TLS .CACertificate = string (encodedCAs )
606+
599607 _ , err = r .routeClient .RouteV1 ().Routes (route .Namespace ).Update (ctx , route , metav1.UpdateOptions {})
600608 return err
601609}
You can’t perform that action at this time.
0 commit comments