ASK Knative uses Server Load Balancer (SLB) instances as gateways. Knative gateways support both HTTP and HTTPS. By default, Knative generates a self-signed certificate for HTTPS connections. This certificate can secure all domain names. Therefore, you can use the certificate to test applications. Before you use Knative to deploy applications, configure an SSL certificate and specify the certificate ID in Kubernetes annotations. This topic describes how to view, create, and use an SSL certificate.

For more information about Knative gateways, see Knative Gateway.

View the default certificate

On the Certificates page, find knative-default-gateway-cert. The knative-default-gateway-cert certificate is the default certificate of Knative. The default certificate is automatically generated by Knative. You can use this certificate to test applications.

Create a certificate

You can use a certificate issued by Alibaba Cloud or upload a third-party certificate. For more information, see Use a certificate from Alibaba Cloud SSL Certificates Service and Upload a third-party certificate.

Use a certificate that you create

  1. On the Certificates page, find the certificate that you want to use, move the pointer over the certificate ID, and then click the Copy the certificate ID icon in the Certificate Name/ID column. The certificate ID is copied.
  2. Before you use Knative, configure a gateway. In the following code block, set to the certificate ID that you obtain in step 1. Then, you can use the certificate for HTTPS connections.
    apiVersion: v1
    kind: Service
      annotations: "https:443" "${YOUR_CERT_ID}"
      name: nginx
      - port: 443
        protocol: TCP
        targetPort: 80
        run: nginx
      type: LoadBalancer

Manage multi-domain certificates

SLB supports multi-domain SSL certificates. This allows you to secure multiple domains by using a single certificate. You can configure multiple certificates for an SLB instance.
Note For more information about how to manage domains, see Add an additional certificate.
  1. On the Listener tab, find the HTTPS listener that you create, and choose More > Manage Additional Certificate in the Actions column.
    Note On the Listener tab, HTTPS is displayed in the Frontend Protocol/Port column. This indicates that an HTTPS listener is configured.
  2. In the Manage Additional Certificate panel, click Add Additional Certificate, and specify Additional Certificate and Select Server Certificate.

    A domain can contain only letters, digits, hyphens (-), and periods (.),and must start with a letter or a digit. To check whether the domain is valid, use the domain detection tool.

  3. Click OK.