Skip to content

Commit

Permalink
skip empty ocsp staple configuration (istio#45159)
Browse files Browse the repository at this point in the history
Signed-off-by: Faseela K <[email protected]>
  • Loading branch information
kfaseela committed May 26, 2023
1 parent 0991774 commit d4aa7e5
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions pilot/pkg/xds/sds.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,26 +407,29 @@ func toEnvoyTLSSecret(name string, certInfo *credscontroller.CertInfo, proxy *mo
},
})
default:
tlsCertificate := &envoytls.TlsCertificate{
CertificateChain: &core.DataSource{
Specifier: &core.DataSource_InlineBytes{
InlineBytes: certInfo.Cert,
},
},
PrivateKey: &core.DataSource{
Specifier: &core.DataSource_InlineBytes{
InlineBytes: certInfo.Key,
},
},
}
if certInfo.Staple != nil {
tlsCertificate.OcspStaple = &core.DataSource{
Specifier: &core.DataSource_InlineBytes{
InlineBytes: certInfo.Staple,
},
}
}
res = protoconv.MessageToAny(&envoytls.Secret{
Name: name,
Type: &envoytls.Secret_TlsCertificate{
TlsCertificate: &envoytls.TlsCertificate{
CertificateChain: &core.DataSource{
Specifier: &core.DataSource_InlineBytes{
InlineBytes: certInfo.Cert,
},
},
PrivateKey: &core.DataSource{
Specifier: &core.DataSource_InlineBytes{
InlineBytes: certInfo.Key,
},
},
OcspStaple: &core.DataSource{
Specifier: &core.DataSource_InlineBytes{
InlineBytes: certInfo.Staple,
},
},
},
TlsCertificate: tlsCertificate,
},
})
}
Expand Down

0 comments on commit d4aa7e5

Please sign in to comment.