Cuando configuras un TargetServer para que admita TLS, debes especificar un almacén de claves o un almacén de confianza mediante una referencia. Una referencia es una variable que contiene el nombre del almacén de claves o del almacén de confianza, en lugar de especificar directamente el nombre del almacén de claves.
Una referencia puede representarse con un objeto XML como el que se muestra a continuación:
La ventaja de usar una referencia es que puedes cambiar el valor de la referencia para cambiar el almacén de claves que usa el servidor de destino, por lo general, porque el certificado del almacén de claves actual vencerá pronto.
Solo puedes usar una referencia al almacén de claves y al almacén de confianza; no puedes usar una referencia al alias. Cuando cambies la referencia a un almacén de claves, asegúrate de que el nombre de alias del certificado sea el mismo que en el almacén de claves anterior.
Restricciones para el uso de referencias a almacenes de claves y al almacén de confianza
Si tienes un balanceador de cargas y cierras TLS en él, no puedes usar referencias a almacenes de claves y almacenes de confianza en el servidor de destino.
Crea una referencia
Puedes usar la IU o la API de Apigee para crear una referencia nueva.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-03 (UTC)"],[[["\u003cp\u003eThis documentation applies to both Apigee and Apigee hybrid platforms, focusing on TargetServer TLS configurations.\u003c/p\u003e\n"],["\u003cp\u003eReferences are variables used to specify keystores or truststores in TLS configurations, allowing for easy updates without direct name changes.\u003c/p\u003e\n"],["\u003cp\u003eUsing references for keystores or truststores allows you to change the keystore utilized by the target server, typically for certificate renewals, without needing to change the alias.\u003c/p\u003e\n"],["\u003cp\u003eReferences for keystores and truststores are incompatible with load balancers that terminate TLS.\u003c/p\u003e\n"],["\u003cp\u003eReferences can be created and modified via both the Apigee UI and API, which include steps and code examples.\u003c/p\u003e\n"]]],[],null,["# Working with References\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\nWhen configuring a TargetServer to support TLS, you specify a keystore or truststore by using\na reference. A reference is a variable that contains the name of the keystore or truststore,\nrather than specifying the keystore or truststore name directly.\n\nA reference can be represented by an XML object like the one below: \n\n```xml\n \u003creference\u003e\n \u003cname\u003eReferenceName\u003c/name\u003e\n \u003cdescription\u003eReferencDescription\u003c/description\u003e\n \u003cresourceType\u003eReferredResourceType\u003cresourceType\u003e\n \u003crefers\u003eReferredResource\u003crefers\u003e\n \u003c/reference\u003e\n```\n\nThe advantage to using a reference is that you can change the value of the reference to change\nthe keystore used by the target server, usually because the cert in the current keystore is\nexpiring in the near future.\n\nYou can only use a reference to the keystore and truststore; you cannot use a reference to the\nalias. When you change the reference to a keystore, ensure that the alias name of the cert is the\nsame as in the old keystore.\n\n#### Restrictions on using references to keystores and truststore\n\nIf you have a load balancer and terminate TLS on the\nload balancer, then you cannot use keystore and truststore references in the target server.\n\nCreate a reference\n------------------\n\nYou can use the Apigee UI or API to create a new reference.\n\n### Apigee in Google Cloud console\n\nTo create a reference using the Google Cloud console:\n\n1. In the Google Cloud console, go to the **Management \\\u003e Environments** page.\n\n [Go to Environments](https://console.cloud.google.com/apigee/environments)\n2. Select the desired environment where you want to create the reference.\n\n3. Click the **References** tab.\n\n4. Click **Create Reference**.\n\n5. In the **Create Reference** pane, enter the following details:\n - **Name**: The name of the reference.\n - **Keystore**: The keystore to which the reference points.\n6. Click **Create**.\n\n### Classic UI\n\nTo create a reference using the UI:\n\n1. Log in to the [Apigee UI](https://apigee.google.com).\n2. Select the name of your organization.\n3. Select **Admin \\\u003e Environments \\\u003e References**.\n4. Select the Environment (typically `prod` or `test`).\n5. Select the **+ Reference** button.\n6. In the **Add Reference** pop-up:\n 1. Add the **Name** of the reference.\n 2. Select the **Reference**, the referred keystore or truststore.\n 3. Select **Add Reference**.\n\n### API\n\nTo create a reference using the [Create\nReference](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments.references/create) API call: \n\n```\n curl -H \"Authorization: Bearer $TOKEN\" \\\n -X POST \\\n -d '{\n \"reference\": {\n \"name\": MyReferenceName\",\n \"resourceType\": \"KeyStore\",\n \"refers\": \"KeyStoreID\"\n }\n }' \\\n https://apigee.googleapis.com/v1/{parent=organizations/*/environments/*}/references\n```\n\nModify a reference\n------------------\n\nYou can use the Apigee UI or API to modify an existing reference.\n\n### Apigee in Google Cloud console\n\nTo modify a reference using the Google Cloud console:\n\n1. In the Google Cloud console, go to the **Management \\\u003e Environments** page.\n\n [Go to Environments](https://console.cloud.google.com/apigee/environments)\n2. Select the desired environment where you want to modify the reference.\n\n3. Click the **References** tab.\n\n4. In the displayed list, select the reference that you want to modify.\n\n5. Click more_vert **Actions** \\\u003e **Edit**.\n\n6. In the **Edit Reference** pane, update the reference to specify the new keystore.\n7. Click **Update**.\n\n### Classic Apigee UI\n\nTo modify the value of a reference in the UI:\n\n1. Log in to the [Apigee UI](https://apigee.google.com).\n2. Select the name of your organization.\n3. Select **Admin \\\u003e Environments \\\u003e References**.\n4. Select the Environment (typically `prod` or `test`).\n5. Select the **Edit** button for the reference.\n6. Update the reference to specify the new keystore or truststore. **Caution**: Ensure that the alias in the new keystore has the same name as the alias in the old keystore.\n7. Save your updates.\n\n### API\n\nTo change the reference to point to a different keystore, ensuring that the alias in the new\nkeystore has the same name as the alias in the old keystore, use the [Update Reference](https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments.references/update) API: \n\n```\n curl -H \"Authorization: Bearer $TOKEN\" \\\n -X PUT \\\n -d '{\n \"name\": \"MyReferenceName\",\n \"resourceType\": \"KeyStore\",\n \"refers\": \"KeyStoreID\"\n }' \\\n https://apigee.googleapis.com/v1/{name=organizations/*/environments/*/references/*}\n \n```"]]