> [!CAUTION]
> You are currently viewing version 1.8 of the Apigee hybrid documentation. **This version is end of life.** You should upgrade to a newer version. For more information, see [Supported versions](https://docs.cloud.google.com/apigee/docs/hybrid/supported-platforms.md.txt#supported-versions).

<button class="button button-with-icon cloud-select-dropdown__button button-primary" aria-haspopup="true">Version 1.8 (unsupported)</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"
```


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.8/install-create-tls-certificates.md.txt).

### 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 one of the two following namespaces:
   - `apigee` namespace if you are using Apigee ingress gateway.
   - `istio-system` namespace if you are using customer-installed Anthos Service Mesh.

   ### Apigee ingress gateway

   ```
   kubectl create -n apigee secret generic $SECRET_NAME  \
   --from-file=key=$KEY_FILE \
   --from-file=cert=$CERT_FILE
   ```

   ### Anthos Service Mesh

   ```
   kubectl create -n istio-system 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
   ```

## Configuring mTLS


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


Provide a Certificate Authority (CA) certificate with SSL cert and key files in the
`virtualhosts` property in your overrides file:

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


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> is an authorized certificate, 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.8/install-create-tls-certificates.md.txt).

### Option 2: Kubernetes Secrets

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 in one ofthe two following namespaces:
   - `apigee` namespace if you are using Apigee ingress gateway.
   - `istio-system` namespace if you are using customer-installed Anthos Service Mesh.

   ### Apigee ingress gateway

   ```
   kubectl create -n apigee secret generic $SECRET_NAME  \
   --from-file=key=$KEY_FILE \
   --from-file=cert=$CERT_FILE
   ```

   ### Anthos Service Mesh

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

   ### Apigee ingress gateway

   ```
   kubectl create -n apigee secret generic $SECRET_NAME-cacert  \
   --from-file=cacert=$CA_FILE
   ```

   ### Anthos Service Mesh

   ```
   kubectl create -n istio-system 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
   ```