AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Sets the certificate that terminates the specified listener's SSL connections. The specified certificate replaces any prior certificate that was used on the same load balancer and port.
For more information about updating your SSL certificate, see Replace the SSL Certificate for Your Load Balancer in the Classic Load Balancers Guide.
For .NET Core this operation is only available in asynchronous form. Please refer to SetLoadBalancerListenerSSLCertificateAsync.
Namespace: Amazon.ElasticLoadBalancing
Assembly: AWSSDK.ElasticLoadBalancing.dll
Version: 3.x.y.z
public abstract SetLoadBalancerListenerSSLCertificateResponse SetLoadBalancerListenerSSLCertificate( SetLoadBalancerListenerSSLCertificateRequest request )
Container for the necessary parameters to execute the SetLoadBalancerListenerSSLCertificate service method.
Exception | Condition |
---|---|
AccessPointNotFoundException | The specified load balancer does not exist. |
CertificateNotFoundException | The specified ARN does not refer to a valid SSL certificate in AWS Identity and Access Management (IAM) or AWS Certificate Manager (ACM). Note that if you recently uploaded the certificate to IAM, this error might indicate that the certificate is not fully available yet. |
InvalidConfigurationRequestException | The requested configuration change is not valid. |
ListenerNotFoundException | The load balancer does not have a listener configured at the specified port. |
UnsupportedProtocolException | The specified protocol or signature version is not supported. |
This example replaces the existing SSL certificate for the specified HTTPS listener.
var client = new AmazonElasticLoadBalancingClient(); var response = client.SetLoadBalancerListenerSSLCertificate(new SetLoadBalancerListenerSSLCertificateRequest { LoadBalancerName = "my-load-balancer", LoadBalancerPort = 443, SSLCertificateId = "arn:aws:iam::123456789012:server-certificate/new-server-cert" });
.NET Framework:
Supported in: 4.5, 4.0, 3.5