put-bucket-https-config
Enables or disables Transport Layer Security (TLS) version management for a bucket.
Usage notes
An Alibaba Cloud account has the permissions to enable or disable TLS version management for a bucket by default. To perform this operation as a RAM user or by using Security Token Service (STS), you must have the oss:PutBucketHttpsConfig permission. For more information, see Attach a custom policy to a RAM user.
Command syntax
ossutil api put-bucket-https-config --bucket value --https-configuration value [flags]
|
Parameter |
Type |
Description |
|
--bucket |
string |
The name of the bucket. |
|
--https-configuration |
string |
The container that stores the TLS version configurations. |
The put-bucket-https-config command corresponds to the PutBucketHttpsConfig operation. For more information about the parameters, see PutBucketHttpsConfig.
--https-configuration
The --https-configuration option supports both XML and JSON formats. If the value contains the file:// prefix, ossutil reads the configurations from a local file.
-
XML format:
<HttpsConfiguration> <TLS> <Enable>boolean</Enable> <TLSVersion>string</TLSVersion> ... </TLS> </HttpsConfiguration> -
JSON format:
{ "TLS": { "Enable": boolean, "TLSVersion": ["string", ...] } }
For more information about global command-line options, see Global command-line options.
Examples
Enable TLS version management for a bucket named examplebucket and set the TLS version to TLS 1.2 and TLS 1.3.
-
Create an XML configuration file named https-configuration.xml and add the following content:
<?xml version="1.0" encoding="UTF-8"?> <HttpsConfiguration> <TLS> <Enable>true</Enable> <TLSVersion>TLSv1.2</TLSVersion> <TLSVersion>TLSv1.3</TLSVersion> </TLS> </HttpsConfiguration>Sample command:
ossutil api put-bucket-https-config --bucket examplebucket --https-configuration file://https-configuration.xml -
Create a JSON configuration file named https-configuration.json and add the following content:
{ "TLS": { "Enable": "true", "TLSVersion": [ "TLSv1.2", "TLSv1.3" ] } }Sample command:
ossutil api put-bucket-https-config --bucket examplebucket --https-configuration file://https-configuration.json -
Pass the JSON configuration inline:
ossutil api put-bucket-https-config --bucket examplebucket --https-configuration "{\"TLS\":{\"Enable\":\"true\",\"TLSVersion\":[\"TLSv1.2\",\"TLSv1.3\"]}}"