Updated on 2026-08-21 GMT+08:00

Certificate Hosting

Scenarios

If you want to access a bucket using a user-defined domain name over HTTPS, you need to configure an HTTPS certificate for the domain name. In HTTPS, digital certificates are essential for securing communication, preserving data integrity, and verifying identity.

  • Identity authentication uses a certificate to verify that a server is who it claims to be. This in turn helps defend against man-in-the-middle (MITM) attacks and protects users from connecting to a forged phishing website. In certain scenarios (for example, internal enterprise systems), HTTPS mutual authentication can be implemented using digital certificates. In this setup, the client is also required to present a certificate for the server to verify its identity, thereby further enhancing security.
  • Data encryption protects the confidentiality of communications by setting up an encrypted channel between the client and the server. This ensures that the transmitted data (such as passwords, credit card information, and chat content) remains secure. Even if the data is intercepted, it cannot be read.
  • Data integrity protects data from being tampered with. During HTTPS transmission, a hash function (for example, SHA-256) is used to create a message digest and this digest is then encrypted using a session key. This ensures that data is not tampered with or replaced during transmission.

How It Works

HTTPS uses TLS/SSL to provide end-to-end data encryption between the client and the server. It also uses certificates to verify the server identity, ensuring data confidentiality and integrity as well as correct sender identification.

To access OBS over HTTPS, you must configure a valid SSL certificate for the access domain name.

  • Default bucket domain name: The format is bucketname.obs.regionid.myhuaweicloud.com. SSL certificates are managed centrally by Huawei Cloud, and HTTPS is enabled by default. You can access the bucket directly using the https:// prefix.
  • User-defined domain name: You must configure a certificate when setting a user-defined domain name for a bucket. For details, see Configuring a User-Defined Domain Name. You can also configure a certificate after the domain name is set. For details, see Configuring an HTTPS Certificate for a User-Defined Domain Name.

    OBS supports international certificates.

  • CDN acceleration domain name: If a CDN acceleration domain name is configured for a bucket, you must configure a certificate. For details, see Configuring an HTTPS Certificate.

Constraints

  • HTTPS certificate hosting is only available for user-defined domain names.
  • Only common certificates are supported. Chinese cryptographic certificates are not supported.
  • When HTTPS certificates are required, a maximum of 100 user-defined domain names can be configured for each bucket.

Billing Description

To configure certificates for a domain name to access OBS over HTTPS, you must purchase a certificate. For details about the billing of purchasing a certificate on Huawei Cloud, see CCM Billing Items.

Certificate Format

A certificate consists of two parts: the certificate file and the private key.

The certificate file must meet the following requirements:

The certificate file must include information such as the public key and signature. Its file name extension must be .pem or .crt.

  • The certificate file is prefixed with -----BEGIN CERTIFICATE----- and postfixed with -----END CERTIFICATE-----.
  • The certificate file cannot contain blank lines. Each line must contain exactly 64 characters, except for the last line, which can contain fewer.

Example:

-----BEGIN CERTIFICATE-----
MIIDIjCCAougAwIBAgIJALV96mEtVF4EMA0GCSqGSIb3DQEBBQUAMGoxCzAJBgNV
BAYTAnh4MQswCQYDVQQIEwJ4eDELMAkGA1UEBxMCeHgxCzAJBgNVBAoTAnh4MQsw
CQYDVQQLEwJ4eDELMAkGA1UEAxMCeHgxGjAYBgkqhkiG9w0BCQEWC3h4eEAxNjMu
Y29tMB4XDTE3MTExMzAyMjYxM1oXDTIwMTExMjAyMjYxM1owajELMAkGA1UEBhMC
eHgxCzAJBgNVBAgTAnh4MQswCQYDVQQHEwJ4eDELMAkGA1UEChMCeHgxCzAJBgNV
BAsTAnh4MQswCQYDVQQDEwJ4eDEaMBgGCSqGSIb3DQEJARYLeHh4QDE2My5jb20w
gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMU832iM+d3FILgTWmpZBUoYcIWV
cAAYE7FsZ9LNerOyjJpyi256oypdBvGs9JAUBN5WaFk81UQx29wAyNixX+bKa0DB
WpUDqr84V1f9vdQc75v9WoujcnlKszzpV6qePPC7igJJpu4QOI362BrWzJCYQbg4
Uzo1KYBhLFxl0TovAgMBAAGjgc8wgcwwHQYDVR0OBBYEFMbTvDyvE2KsRy9zPq/J
WOjovG+WMIGcBgNVHSMEgZQwgZGAFMbTvDyvE2KsRy9zPq/JWOjovG+WoW6kbDBq
MQswCQYDVQQGEwJ4eDELMAkGA1UECBMCeHgxCzAJBgNVBAcTAnh4MQswCQYDVQQK
EwJ4eDELMAkGA1UECxMCeHgxCzAJBgNVBAMTAnh4MRowGAYJKoZIhvcNAQkBFgt4
eHhAMTYzLmNvbYIJALV96mEtVF4EMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEF
BQADgYEAASkC/1iwiALa2RU3YCxqZFEEsZZvQxikrDkDbFeoa6Tk49Fnb1f7FCW6
PTtY3HPWl5ygsMsSy0Fi3xp3jmuIwzJhcQ3tcK5gC99HWp6Kw37RL8WoB8GWFU0Q
4tHLOjBIxkZROPRhH+zMIrqUexv6fsb3NWKhnlfh1Mj5wQE4Ldo=
-----END CERTIFICATE-----

The private key must meet the following requirements:

The private key must have the .key extension and must not have a password. The format of the private key is as follows:

  • The private key is a PEM encoded file.
    • The private key is prefixed with -----BEGIN RSA PRIVATE KEY----- and postfixed with -----END RSA PRIVATE KEY-----.
  • The private key cannot contain blank lines. Each line must contain exactly 64 characters, except for the last line, which can contain fewer.

Example:

-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQDFPN9ojPndxSC4E1pqWQVKGHCFlXAAGBOxbGfSzXqzsoyacotu
eqMqXQbxrPSQFATeVmhZPNVEMdvcAMjYsV/mymtAwVqVA6q/OFdX/b3UHO+b/VqL
o3J5SrM86Veqnjzwu4oCSabuEDiN+tga1syQmEG4OFM6NSmAYSxcZdE6LwIDAQAB
AoGBAJvLzJCyIsCJcKHWL6onbSUtDtyFwPViD1QrVAtQYabF14g8CGUZG/9fgheu
TXPtTDcvu7cZdUArvgYW3I9F9IBb2lmF3a44xfiAKdDhzr4DK/vQhvHPuuTeZA41
r2zp8Cu+Bp40pSxmoAOK3B0/peZAka01Ju7c7ZChDWrxleHZAkEA/6dcaWHotfGS
eW5YLbSms3f0m0GH38nRl7oxyCW6yMIDkFHURVMBKW1OhrcuGo8u0nTMi5IH9gRg
5bH8XcujlQJBAMWBQgzCHyoSeryD3TFieXIFzgDBw6Ve5hyMjUtjvgdVKoxRPvpO
kclc39QHP6Dm2wrXXHEej+9RILxBZCVQNbMCQQC42i+Ut0nHvPuXN/UkXzomDHde
h1ySsOAO4H+8Y6OSI87l3HUrByCQ7stX1z3L0HofjHqV9Koy9emGTFLZEzSdAkB7
Ei6cUKKmztkYe3rr+RcATEmwAw3tEJOHmrW5ErApVZKr2TzLMQZ7WZpIPzQRCYnY
2ZZLDuZWFFG3vW+wKKktAkAaQ5GNzbwkRLpXF1FZFuNF7erxypzstbUmU/31b7tS
i5LmxTGKL/xRYtZEHjya4Ikkkgt40q1MrUsgIYbFYMf2
-----END RSA PRIVATE KEY-----

Configuring an HTTPS Certificate for a User-Defined Domain Name

You can use OBS Console, APIs, or obsutil to configure HTTPS certificates for user-defined domain names. You cannot use SDKs or OBS Browser+ to do so.

Accessing an Object over HTTPS

After configuring HTTPS for a user-defined domain name, use a browser to verify HTTPS access to your objects through that domain name. You can use SDKs to access objects over HTTPS through a user-defined domain name. You cannot use OBS Console, APIs, OBS Browser+, or obsutil to do so.

Forcing Clients to Access OBS over HTTPS

In scenarios requiring strict transmission security, you can configure a bucket policy to reject HTTP requests from all clients, preventing data from being intercepted or tampered with during transmission.

  1. In the navigation pane of OBS Console, choose Buckets.
  2. In the bucket list, click the desired bucket. The Objects page is displayed.
  3. In the navigation pane, choose Permissions > Bucket Policies.
  4. Click Create.
  5. Configure a bucket policy.

    Figure 1 Configuring a bucket policy
    Table 2 Parameters for configuring a custom bucket policy

    Parameter

    Value Example

    Description

    Policy View

    Visual Editor

    Choose Visual Editor or JSON. The visual editor is used here. For details about configurations in the JSON view, see Creating a Custom Bucket Policy (JSON View).

    Policy Name

    deny_http

    Enter a custom policy name.

    The policy name cannot be left blank.

    Effect

    Deny.

    • Allow: The policy allows the matched requests.
    • Deny: The policy denies the matched requests.

    Principal

    All accounts

    • All accounts: The bucket policy applies to all Internet users.
    • Current account: You can select one or more IAM users under the current account.
    • Other accounts: You can set one or more other accounts.
      • The account ID and IAM user ID can be obtained from the My Credentials page.
      • You can click Add Other Account to add multiple accounts.
      • If you enter an IAM user ID or name as *, you are granting permissions to all users under the account.
    • Delegated account: You can set one or more delegated accounts.

      You can click Add Delegated Account to add multiple delegated accounts.

    Resources

    Entire bucket (including the objects in it)

    • Entire bucket (including the objects in it): The policy applies to the bucket and the objects in it. You can configure bucket and object actions in this policy.
    • Current bucket: The policy applies to the current bucket. You can configure bucket actions in this policy.
    • Specified objects: The policy applies to specified objects in the bucket. You can configure object actions in this policy.
      • Multiple resource paths can be specified.
      • A resource path should be configured in the Folder name/Object name format, for example, testdir/a.txt. To specify the testdir folder and all objects in it, enter testdir/*.
      • You can specify a specific object, an object set, or a directory. * indicates all objects in the bucket.
        • To specify a specific object, enter the object name.
        • To specify a set of objects, enter Object name prefix*, *Object name suffix, or *. For example, testdir/* indicates objects in the testdir folder, and testprefix* indicates objects with the prefix testprefix.

    Actions

    Customize

    * for Select Actions

    Configure the actions authorized by the bucket policy. You can use a template or customize the configuration.
    • Use a template: OBS preconfigures multiple bucket policy templates for common scenarios, helping you quickly configure bucket policies. For details, see Creating a Bucket Policy with a Template.
    • Customize: You can customize authorization actions. If you select Customize, you also need to select specific actions.
      Select Actions: See Bucket Policy Parameters.
      NOTE:
      • If you select Entire bucket (including the objects in it) for Resources, common actions, bucket actions, and object actions will be available for you to choose from.
      • If you select Current bucket for Resources, common actions and bucket actions will be available for you to choose from.
      • If you select Specified objects for Resources, common actions and object actions will be available for you to choose from.
      • If you select both Current bucket and Specified objects for Resources, common actions, bucket actions, and object actions will be available for you to choose from.

    Conditions (Optional)

    Key: SecureTransport

    Qualifier: default

    Condition Operator: Bool

    Value: false

    This parameter is optional. Use this parameter to specify the conditions for a bucket policy to take effect.

  6. Click Create in the lower right corner.

You can also use JSON to configure a bucket policy to deny HTTP requests from all clients.

{
    "Statement": [
        {
            "Sid": "deny_http",
            "Effect": "Deny",
            "Principal": {
                "ID": [
                    "*"
                ]
            },
            "Action": [
                "*"
            ],
            "Resource": [
                "dfhjhkmk",
                "dfhjhkmk/*"
            ],
            "Condition": {
                "Bool": {
                    "SecureTransport": [
                        "false"
                    ]
                }
            }
        }
    ]
}

Managing the Certificate Lifecycle

Disabling HTTPS Access

You can use OBS Console, APIs, SDKs, or obsutil to disable HTTPS access for user-defined domain names. You cannot use OBS Browser+ to do so.

References