Uploading a Certificate

If you select Cloud mode or Dedicated mode for website deployment and set Client Protocol to HTTPS, a certificate must be associated with the website.

You can upload a certificate to WAF. Then you can directly select the uploaded certificate for the protected website.

If you have enabled enterprise projects, you can select your enterprise project from the Enterprise Project drop-down list and create certificates in the project.

Prerequisites

You have obtained the certificate file and certificate private key.

Specification Limitations

You can upload as many certificates in WAF as the number of domain names that can be protected by your WAF instances in the same account. For example, if you purchase a standard (former professional) edition WAF instance, which can protect 10 domain names, a dedicated WAF instance, which can protect 2,000 domain names, and a domain name expansion package (20 domain names), your WAF instances can protect 2,030 domain names total (2,000 + 20 +10). In this case, you can upload 2,030 certificates.

Constraints

  • If you purchase a certificate on the SCM console and push it to WAF, the certificate is added to the certificate list on the Certificates page on the WAF console. This certificate is also counted towards your total certificate quota. For details about how to push an SSL certificate in SCM to WAF, see Pushing Certificates to Other Services on HUAWEI CLOUD

    Currently, certificates purchased in HUAWEI CLOUD SCM can be pushed only to the default enterprise project. For other enterprise projects, SSL certificates pushed by SCM cannot be used.

  • If you import a new certificate when adding a protected website or updating a certificate, the certificate is added to the certificate list on the Certificates page, and the imported certificate is also counted towards your total certificate quota.

Application Scenario

If you select HTTPS for Client Protocol, a certificate is required.

Procedure

  1. Log in to the management console.
  2. Go to the Certificates page by following the steps shown in Figure 1.

    Figure 1 Access to the Certificates page

  3. In the upper left corner of the certificate list, click Upload Certificate.
  4. In the Upload Certificate dialog box, enter a certificate name, and copy and paste the certificate file and private key into the corresponding text boxes. Figure 2 shows an example.

    Figure 2 Upload Certificate

    Only .pem certificates can be used in WAF. If the certificate is not in .pem format, convert it into a .pem certificate locally by referring to Table 1 before uploading.
    Table 1 Certificate conversion commands

    Format

    Conversion Method

    CER/CRT

    Rename the cert.crt certificate file to cert.pem.

    PFX

    • Obtain a private key. For example, run the following command to convert cert.pfx into key.pem:

      openssl pkcs12 -in cert.pfx -nocerts -out key.pem -nodes

    • Obtain a certificate. For example, run the following command to convert cert.pfx into cert.pem:

      openssl pkcs12 -in cert.pfx -nokeys -out cert.pem

    P7B

    1. Convert a certificate. For example, run the following command to convert cert.p7b into cert.cer:

      openssl pkcs7 -print_certs -in cert.p7b -out cert.cer

    2. Rename certificate file cert.cer to cert.pem.

    DER

    • Obtain a private key. For example, run the following command to convert privatekey.der into privatekey.pem:

      openssl rsa -inform DER -outform PEM -in privatekey.der -out privatekey.pem

    • Obtain a certificate. For example, run the following command to convert cert.cer into cert.pem:

      openssl x509 -inform der -in cert.cer -out cert.pem

    • Before running an OpenSSL command, ensure that the OpenSSL tool has been installed on the local host.
    • If your local PC runs a Windows operating system, go to the command line interface (CLI) and then run the certificate conversion command.

  5. Click OK.

Verification

The certificate you created is displayed in the certificate list.

Other Operations

  • To change the certificate name, move the cursor over the name of the certificate, click , and enter a certificate name.

    If the certificate is in use, unbind the certificate from the domain name first. Otherwise, the certificate name cannot be changed.

  • To view details about a certificate, click View in the Operation column of the certificate.
  • In the row containing the certificate you want, click Use in the Operation column to use the certificate to the corresponding domain name.
  • To delete a certificate, locate the row of the certificate and click Delete in the Operation column.