Associates an SSL certificate with the forwarding rule of a website.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | AssociateWebCert |
The operation that you want to perform. Set the value to AssociateWebCert. |
Domain | String | Yes | www.aliyun.com |
The domain name of the website. Note A forwarding rule must be configured for the domain name. You can call the DescribeDomains operation to query all domain names.
|
RegionId | String | No | cn-hangzhou |
The region ID of the instance. Valid values:
|
ResourceGroupId | String | No | default |
The ID of the resource group to which the instance belongs in Resource Management. This parameter is empty by default, which indicates that the instance belongs to the default resource group. |
CertId | Integer | No | 2404693 |
The ID of the SSL certificate that you want to associate. If the SSL certificate that you want to associate has been issued in SSL Certificate Service, you can enter the certificate ID to associate the certificate. Note If you enter the certificate ID, you do not need to specify CertName, Cert, and Key.
|
CertName | String | No | example-cert |
The name of the certificate that you want to associate. If you set this parameter, you must also specify the Cert and Key parameters. Note If you specify CertName, Cert, and Key, you do not need to specify CertId.
|
Cert | String | No | -----BEGIN CERTIFICATE----- 62EcYPWd2Oy1vs6MTXcJSfN9Z7rZ9fmxWr2BFN2XbahgnsSXM48ixZJ4krc+1M+j2kcubVpsE2cgHdj4v8H6jUz9Ji4mr7vMNS6dXv8PUkl/qoDeNGCNdyTS5NIL5ir+g92cL8IGOkjgvhlqt9vc65Cgb4mL+n5+DV9uOyTZTW/MojmlgfUekC2xiXa54nxJf17Y1TADGSbyJbsC0Q9nIrHsPl8YKkvRWvIAqYxXZ7wRwWWmv4TMxFhWRiNY7yZIo2ZUhl02SIDNggIEeg== -----END CERTIFICATE----- |
The public key of the certificate that you want to associate. If you set this parameter, you must also specify the CertName and Key parameters. Note If you specify CertName, Cert, and Key, you do not need to specify CertId.
|
Key | String | No | -----BEGIN RSA PRIVATE KEY----- DADTPZoOHd9WtZ3UKHJTRgNQmioPQn2bqdKHop+B/dn/4VZL7Jt8zSDGM9sTMThLyvsmLQKBgQCr+ujntC1kN6pGBj2Fw2l/EA/W3rYEce2tyhjgmG7rZ+A/jVE9fld5sQra6ZdwBcQJaiygoIYoaMF2EjRwc0qwHaluq0C15f6ujSoHh2e+D5zdmkTg/3NKNjqNv6xA2gYpinVDzFdZ9Zujxvuh9o4Vqf0YF8bv5UK5G04RtKadOw== -----END RSA PRIVATE KEY----- |
The private key of the certificate that you want to associate. If you set this parameter, you must also specify the CertName and Cert parameters. Note If you specify CertName, Cert, and Key, you do not need to specify CertId.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 40F11005-A75C-4644-95F2-52A4E7D43E91 |
The ID of the request. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=AssociateWebCert
&Domain=www.aliyun.com
&CertId=2404693
&<Common request parameters>
Sample success responses
XML
format
<AssociateWebCertResponse>
<RequestId>40F11005-A75C-4644-95F2-52A4E7D43E91</RequestId>
</AssociateWebCertResponse>
JSON
format
{
"RequestId": "40F11005-A75C-4644-95F2-52A4E7D43E91"
}
Error codes
For a list of error codes, visit the API Error Center.