Add support for multiple certificates to targetproxy

This commit is contained in:
Bowei Du 2018-04-02 23:34:08 -07:00
parent 8b94183e90
commit 635ee5ad55

View File

@ -85,10 +85,14 @@ func (gce *GCECloud) SetUrlMapForTargetHttpsProxy(proxy *compute.TargetHttpsProx
}
// SetSslCertificateForTargetHttpsProxy sets the given SslCertificate for the given TargetHttpsProxy.
func (gce *GCECloud) SetSslCertificateForTargetHttpsProxy(proxy *compute.TargetHttpsProxy, sslCert *compute.SslCertificate) error {
func (gce *GCECloud) SetSslCertificateForTargetHttpsProxy(proxy *compute.TargetHttpsProxy, sslCerts []*compute.SslCertificate) error {
mc := newTargetProxyMetricContext("set_ssl_cert")
var allCerts []string
for _, cert := range sslCerts {
allCerts = append(allCerts, cert.SelfLink)
}
req := &compute.TargetHttpsProxiesSetSslCertificatesRequest{
SslCertificates: []string{sslCert.SelfLink},
SslCertificates: allCerts,
}
return mc.Observe(gce.c.TargetHttpsProxies().SetSslCertificates(context.Background(), meta.GlobalKey(proxy.Name), req))
}