<button class="button button-with-icon cloud-select-dropdown__button button-primary" aria-haspopup="true">Version 1.17 (latest)</button>

- Supported versions:
- [v1.17 (latest)](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/ingress-tls.md.txt)
- [v1.16](https://docs.cloud.google.com/apigee/docs/hybrid/v1.16/ingress-tls.md.txt)
- [v1.15](https://docs.cloud.google.com/apigee/docs/hybrid/v1.15/ingress-tls.md.txt)
- [v1.14](https://docs.cloud.google.com/apigee/docs/hybrid/v1.14/ingress-tls.md.txt)
- [List of supported versions](https://docs.cloud.google.com/apigee/docs/hybrid/supported-platforms.md.txt#supported-versions)
- Unsupported versions:
- [v1.13](https://docs.cloud.google.com/apigee/docs/hybrid/v1.13/ingress-tls.md.txt)
- [v1.12](https://docs.cloud.google.com/apigee/docs/hybrid/v1.12/ingress-tls.md.txt)
- [v1.11](https://docs.cloud.google.com/apigee/docs/hybrid/v1.11/ingress-tls.md.txt)
- [v1.10](https://docs.cloud.google.com/apigee/docs/hybrid/v1.10/ingress-tls.md.txt)
- [v1.9](https://docs.cloud.google.com/apigee/docs/hybrid/v1.9/ingress-tls.md.txt)
- [v1.8](https://docs.cloud.google.com/apigee/docs/hybrid/v1.8/ingress-tls.md.txt)
- [v1.7](https://docs.cloud.google.com/apigee/docs/hybrid/v1.7/ingress-tls.md.txt)
- [v1.6](https://docs.cloud.google.com/apigee/docs/hybrid/v1.6/ingress-tls.md.txt)
- [v1.5](https://docs.cloud.google.com/apigee/docs/hybrid/v1.5/ingress-tls.md.txt)
- [v1.4](https://docs.cloud.google.com/apigee/docs/hybrid/v1.4/ingress-tls.md.txt)
- [v1.3](https://docs.cloud.google.com/apigee/docs/hybrid/v1.3/ingress-tls.md.txt)
- [v1.2](https://docs.cloud.google.com/apigee/docs/hybrid/v1.2/ingress-tls.html)
- [v1.1](https://docs.cloud.google.com/apigee/docs/hybrid/v1.1/ingress-tls.html)


This topic explains how to enable one-way TLS and mTLS on the ingressgateway.

## Configuring one-way TLS

Use one-way TLS to secure API proxy endpoints on the ingress gateway. To enable
one-way TLS, you configure the ingress with TLS cert/key pairs or with a Kubernetes
Secret, as explained in the following options.

### Option 1: key/cert pair


Provide SSL cert and key files in the `virtualhosts` property in your overrides file:

```
virtualhosts:
  - name: $ENVIRONMENT_GROUP_NAME
    sslCertPath: "$CERT_FILE"
    sslKeyPath: "$KEY_FILE"
```

> [!NOTE]
> **Note:** See
> - [`virtualhosts.name`](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/config-prop-ref.md.txt#virtualhosts-name)
> - [`virtualhosts.sslCertPath`](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/config-prop-ref.md.txt#virtualhosts-sslcertpath)
> - [`virtualhosts.sslKeyPath`](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/config-prop-ref.md.txt#virtualhosts-sslkeypath)
>

Where <var translate="no">$ENVIRONMENT_GROUP_NAME</var> is the name of an environment group with
corresponding host aliases, and <var translate="no">$CERT_FILE</var> and <var translate="no">$KEY_FILE</var> are TLS key and certificate
files. See [Create TLS certificates](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/install-create-tls-certificates.md.txt).

> [!TIP]
> **Tip:** For security purposes, it is best practice to have a separate TLS cert/key pair for each virtual host. If you are using a Subject Alternative Name (SAN ) certificate, this TLS cert/key pair should be used on one virtual host that is shared across the domain.

### Option 2: Kubernetes Secret


Create a [Kubernetes
Secret](https://kubernetes.io/docs/concepts/configuration/secret/) and add it to your overrides file.

1. Create the Secret in the `apigee` namespace:

   ```
   kubectl create -n APIGEE_NAMESPACE secret generic $SECRET_NAME  \
     --from-file=key=$KEY_FILE \
     --from-file=cert=$CERT_FILE
   ```
2. Configure the `virtualhosts` property in your overrides file:

   ```
   virtualhosts:
     - name: $ENVIRONMENT_GROUP_NAME
       tlsMode: SIMPLE  # Note: SIMPLE is the default, so it is optional.
       sslSecret: $SECRET_NAME
   ```

> [!NOTE]
> **Note:** See
>
> - [`virtualhosts.name`](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/config-prop-ref.md.txt#virtualhosts-name)
> - [`virtualhosts.tlsMode`](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/config-prop-ref.md.txt#virtualhosts-tlsmode)
> - [`virtualhosts.sslSecret`](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/config-prop-ref.md.txt#virtualhosts-sslsecret)

## Configuring mTLS

3. Instead of one-way TLS, you can configure [mTLS](https://en.wikipedia.org/wiki/Mutual_authentication) on the ingress gateway. There are two options for configuring mTLS, as explained below.

### Option 1: key/cert pair and CA file

4. Provide TLS certificate data containing Certificate Authority certificates:

```
virtualhosts:
  - name: $ENVIRONMENT_GROUP_NAME
    tlsMode: MUTUAL
    caCertPath: "$CA_FILE"
    sslCertPath: "$CERT_FILE"
    sslKeyPath: "$KEY_FILE"
```

> [!NOTE]
> **Note:** See
>
> - [`virtualhosts.name`](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/config-prop-ref.md.txt#virtualhosts-name)
> - [`virtualhosts.tlsMode`](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/config-prop-ref.md.txt#virtualhosts-tlsmode)
> - [`virtualhosts.caCertPath`](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/config-prop-ref.md.txt#virtualhosts-cacertpath)
> - [`virtualhosts.sslCertPath`](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/config-prop-ref.md.txt#virtualhosts-sslcertpath)
> - [`virtualhosts.sslKeyPath`](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/config-prop-ref.md.txt#virtualhosts-sslkeypath)

5. Where <var translate="no">$ENVIRONMENT_GROUP_NAME</var> is the name of an environment group with corresponding host aliases, <var translate="no">$CA_FILE</var> specifies TLS certificate data (CA bundle file) containing Certificate Authority certificates, and <var translate="no">$CERT_FILE</var> and <var translate="no">$KEY_FILE</var> are TLS key and certificate files. See [Create TLS certificates](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/install-create-tls-certificates.md.txt).

### Option 2: Kubernetes Secrets

6. Create two Kubernetes Secrets. The first secret is for the SSL cert/key pair and the second is for the CA. Then, add them to your overrides file.
   1. Create two Kubernetes secrets the `apigee` namespace:

      ```
      kubectl create -n APIGEE_NAMESPACE secret generic $SECRET_NAME  \
        --from-file=key=$KEY_FILE \
        --from-file=cert=$CERT_FILE
      ```
   2. Create a secret for the CA:

      ```
      kubectl create -n APIGEE_NAMESPACE secret generic $SECRET_NAME-cacert  \
        --from-file=cacert=$CA_FILE
      ```
   3. Configure the `virtualhosts` property in your overrides file:

      ```
      virtualhosts:
        - name: $ENVIRONMENT_GROUP_NAME
          tlsMode: MUTUAL  # Note: Be sure to specify MUTUAL
          sslSecret: $SECRET_NAME
      ```

   > [!NOTE]
   > **Note:** See
   >
   > - [`virtualhosts.name`](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/config-prop-ref.md.txt#virtualhosts-name)
   > - [`virtualhosts.tlsMode`](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/config-prop-ref.md.txt#virtualhosts-tlsmode)
   > - [`virtualhosts.sslSecret`](https://docs.cloud.google.com/apigee/docs/hybrid/v1.17/config-prop-ref.md.txt#virtualhosts-sslsecret)