In diesem Thema wird beschrieben, wie Sie One-Way-TLS und mTLS auf dem Ingress-Gateway aktivieren.
One-Way-TLS konfigurieren
Verwenden Sie One-Way-TLS, um API-Proxyendpunkte auf dem Ingress-Gateway zu schützen. Wenn Sie One-Way-TLS aktivieren möchten, konfigurieren Sie das Ingress mit TLS-Zertifikat/-Schlüsselpaaren oder mit einem Kubernetes-Secret, wie in den folgenden Optionen beschrieben.
Option 1: Schlüssel/Zertifikat-Paar
Geben Sie die SSL-Zertifikats- und SSL-Schlüsseldateien in der Überschreibungsdatei im Attribut virtualhosts an:
Dabei ist $ENVIRONMENT_GROUP_NAME der Name einer Umgebungsgruppe mit entsprechenden Hostaliassen. $CERT_FILE und $KEY_FILE sind TLS-Schlüssel- und TLS-Zertifikatsdateien. Weitere Informationen finden Sie unter TLS-Zertifikate erstellen.
Option 2: Kubernetes-Secret
Erstellen Sie ein Kubernetes Secret und fügen Sie es der Überschreibungsdatei hinzu.
Konfigurieren Sie das Attribut virtualhosts in Ihrer Überschreibungsdatei:
virtualhosts:
- name: $ENVIRONMENT_GROUP_NAME
tlsMode: SIMPLE # Note: SIMPLE is the default, so it is optional.
sslSecret: $SECRET_NAME
mTLS konfigurieren
Anstatt One-Way-TLS zu konfigurieren, können Sie mTLS auf dem Ingress-Gateway konfigurieren. Es gibt zwei Optionen zum Konfigurieren von mTLS. Eine Erklärung für beide finden Sie unten.
Option 1: Schlüssel/Zertifikat-Paar und CA-Datei
Geben Sie TLS-Zertifikatsdaten mit Zertifikaten der Zertifizierungsstelle an:
Dabei ist $ENVIRONMENT_GROUP_NAME der Name einer Umgebungsgruppe mit entsprechenden Hostaliassen, $CA_FILE gibt TLS-Zertifikatsdaten (CA-Bundle-Dateien) an, die Zertifizierungsstellenzertifikate enthalten, und $CERT_FILE und $KEY_FILE sind TLS-Schlüssel- und TLS-Zertifikatsdateien. Weitere Informationen finden Sie unter TLS-Zertifikate erstellen.
Option 2: Kubernetes-Secrets
Zwei Kubernetes-Secrets erstellen. Das erste Secret ist für das SSL-Zertifikat/SSL-Schlüssel-Paar und das zweite für die Zertifizierungsstelle bestimmt. Fügen Sie sie dann der Überschreibungsdatei hinzu.
Erstellen Sie zwei Kubernetes-Secrets im Namespace apigee.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-18 (UTC)."],[[["\u003cp\u003eThis document provides instructions on enabling one-way TLS and mTLS on the ingress gateway for securing API proxy endpoints.\u003c/p\u003e\n"],["\u003cp\u003eOne-way TLS can be configured by providing SSL certificate and key files directly in the \u003ccode\u003evirtualhosts\u003c/code\u003e property, or by using a Kubernetes Secret that contains these files.\u003c/p\u003e\n"],["\u003cp\u003emTLS can be enabled using a key/cert pair and a CA file, where you provide TLS certificate data containing Certificate Authority certificates.\u003c/p\u003e\n"],["\u003cp\u003eAlternatively, mTLS can be configured by creating two Kubernetes Secrets, one for the SSL cert/key pair and another for the CA, and then referencing them in the \u003ccode\u003evirtualhosts\u003c/code\u003e configuration.\u003c/p\u003e\n"]]],[],null,["# Configuring TLS and mTLS on the ingress gateway\n\n| You are currently viewing version 1.14 of the Apigee hybrid documentation. For more information, see [Supported versions](/apigee/docs/hybrid/supported-platforms#supported-versions).\n\n\nThis topic explains how to enable one-way TLS and mTLS on the ingressgateway.\n\nConfiguring one-way TLS\n-----------------------\n\nUse one-way TLS to secure API proxy endpoints on the ingress gateway. To enable\none-way TLS, you configure the ingress with TLS cert/key pairs or with a Kubernetes\nSecret, as explained in the following options.\n\n### Option 1: key/cert pair\n\n\nProvide SSL cert and key files in the `virtualhosts` property in your overrides file: \n\n```scdoc\nvirtualhosts:\n - name: $ENVIRONMENT_GROUP_NAME\n sslCertPath: \"$CERT_FILE\"\n sslKeyPath: \"$KEY_FILE\"\n```\n| **Note:** See\n| - [`virtualhosts.name`](/apigee/docs/hybrid/v1.14/config-prop-ref#virtualhosts-name)\n| - [`virtualhosts.sslCertPath`](/apigee/docs/hybrid/v1.14/config-prop-ref#virtualhosts-sslcertpath)\n| - [`virtualhosts.sslKeyPath`](/apigee/docs/hybrid/v1.14/config-prop-ref#virtualhosts-sslkeypath)\n|\n\nWhere \u003cvar translate=\"no\"\u003e$ENVIRONMENT_GROUP_NAME\u003c/var\u003e is the name of an environment group with\ncorresponding host aliases, and \u003cvar translate=\"no\"\u003e$CERT_FILE\u003c/var\u003e and \u003cvar translate=\"no\"\u003e$KEY_FILE\u003c/var\u003e are TLS key and certificate\nfiles. See [Create TLS certificates](/apigee/docs/hybrid/v1.14/install-create-tls-certificates).\n| **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.\n\n### Option 2: Kubernetes Secret\n\n\nCreate a [Kubernetes\nSecret](https://kubernetes.io/docs/concepts/configuration/secret/) and add it to your overrides file.\n\n1. Create the Secret in the **apigee** namespace: \n\n ```\n kubectl create -n APIGEE_NAMESPACE secret generic $SECRET_NAME \\\n --from-file=key=$KEY_FILE \\\n --from-file=cert=$CERT_FILE\n ```\n2. Configure the `virtualhosts` property in your overrides file: \n\n ```scdoc\n virtualhosts:\n - name: $ENVIRONMENT_GROUP_NAME\n tlsMode: SIMPLE # Note: SIMPLE is the default, so it is optional.\n sslSecret: $SECRET_NAME\n ```\n| **Note:** See\n|\n| - [`virtualhosts.name`](/apigee/docs/hybrid/v1.14/config-prop-ref#virtualhosts-name)\n| - [`virtualhosts.tlsMode`](/apigee/docs/hybrid/v1.14/config-prop-ref#virtualhosts-tlsmode)\n| - [`virtualhosts.sslSecret`](/apigee/docs/hybrid/v1.14/config-prop-ref#virtualhosts-sslsecret)\n\nConfiguring mTLS\n----------------\n\n3. 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.\n\n### Option 1: key/cert pair and CA file\n\n4. Provide TLS certificate data containing Certificate Authority certificates: \n\n```scdoc\nvirtualhosts:\n - name: $ENVIRONMENT_GROUP_NAME\n tlsMode: MUTUAL\n caCertPath: \"$CA_FILE\"\n sslCertPath: \"$CERT_FILE\"\n sslKeyPath: \"$KEY_FILE\"\n```\n| **Note:** See\n|\n| - [`virtualhosts.name`](/apigee/docs/hybrid/v1.14/config-prop-ref#virtualhosts-name)\n| - [`virtualhosts.tlsMode`](/apigee/docs/hybrid/v1.14/config-prop-ref#virtualhosts-tlsmode)\n| - [`virtualhosts.caCertPath`](/apigee/docs/hybrid/v1.14/config-prop-ref#virtualhosts-cacertpath)\n| - [`virtualhosts.sslCertPath`](/apigee/docs/hybrid/v1.14/config-prop-ref#virtualhosts-sslcertpath)\n| - [`virtualhosts.sslKeyPath`](/apigee/docs/hybrid/v1.14/config-prop-ref#virtualhosts-sslkeypath)\n5. Where \u003cvar translate=\"no\"\u003e$ENVIRONMENT_GROUP_NAME\u003c/var\u003e is the name of an environment group with corresponding host aliases, \u003cvar translate=\"no\"\u003e$CA_FILE\u003c/var\u003e specifies TLS certificate data (CA bundle file) containing Certificate Authority certificates, and \u003cvar translate=\"no\"\u003e$CERT_FILE\u003c/var\u003e and \u003cvar translate=\"no\"\u003e$KEY_FILE\u003c/var\u003e are TLS key and certificate files. See [Create TLS certificates](/apigee/docs/hybrid/v1.14/install-create-tls-certificates).\n\n### Option 2: Kubernetes Secrets\n\n6. 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.\n 1. Create two Kubernetes secrets the **apigee** namespace: \n\n ```\n kubectl create -n APIGEE_NAMESPACE secret generic $SECRET_NAME \\\n --from-file=key=$KEY_FILE \\\n --from-file=cert=$CERT_FILE\n ```\n 2. Create a secret for the CA: \n\n ```\n kubectl create -n APIGEE_NAMESPACE secret generic $SECRET_NAME-cacert \\\n --from-file=cacert=$CA_FILE\n ```\n 3. Configure the `virtualhosts` property in your overrides file: \n\n ```scdoc\n virtualhosts:\n - name: $ENVIRONMENT_GROUP_NAME\n tlsMode: MUTUAL # Note: Be sure to specify MUTUAL\n sslSecret: $SECRET_NAME\n ```\n | **Note:** See\n |\n | - [`virtualhosts.name`](/apigee/docs/hybrid/v1.14/config-prop-ref#virtualhosts-name)\n | - [`virtualhosts.tlsMode`](/apigee/docs/hybrid/v1.14/config-prop-ref#virtualhosts-tlsmode)\n | - [`virtualhosts.sslSecret`](/apigee/docs/hybrid/v1.14/config-prop-ref#virtualhosts-sslsecret)"]]