Backend authenticated TLS and backend mTLS overview Stay organized with collections Save and categorize content based on your preferences.
When a load balancer connects to backends that are within Google Cloud, the loadbalancer accepts any certificate that your backends present. In suchcases, the load balancer doesn't perform any certificate validation.
Withbackend authenticated TLS or backend authentication, the load balancercan verify the identity of the backends that it connects to. And withbackend mTLS, the load balancer can additionally prove its identity tobackends by using a client TLS certificate.
The following diagram shows the difference between frontend and backendmTLS, focusing on the role of the load balancer in each case. In frontend mTLS,the load balancer acts as theserver, verifying the client's identity. Inbackend mTLS, the load balancer acts as theclient, proving its identity tothe backend.
mTLS operates independently on the frontend and the backend. You can configuremTLS on either the frontend, the backend, or both the frontend and the backend.
This document provides an overview of backend authenticated TLS along withbackend mTLS. To learn more about frontend mTLS, seeMutual TLSoverview.
Backend authenticated TLS and backend mTLS can be configured on the backendservice resource of the following load balancers:
- Global external Application Load Balancers
- Regional external Application Load Balancers
- Regional internal Application Load Balancers
Features
mTLS uses public key infrastructure (PKI) to authenticate the identity of theentities communicating over the network. The infrastructure includes threecomponents: a client, a server, and a certificate authority (CA). Backendauthenticated TLS and backend mTLS add the following capabilities toApplication Load Balancers:
The load balancer can validate certificates presented by backendsagainst your own trust anchors. You can upload multiple trust anchors toenable seamless migration from an earlier PKI to a new one without downtime.
The load balancer can validate TLS certificates of backends against publicroots of trust (web PKI).
You can configure intermediate certificates in addition to your trustanchors to help construct the backend certificate validation path. The useof intermediate certificates means that your backend servers don't need toprovide the complete certificate chain.
You can configure a TLS Server Name Indication (SNI) hostname for yourbackend service. During the TLS handshake, the load balancer includes thisSNI hostname in the
ClientHellomessage that it sends to the backend. Thebackend then responds with its TLS certificate, and the load balancerverifies that at least one of this certificate's Subject Alternative Name(SAN) fields matches the hostname or any of the SAN fields configured forthe backend service.You can configure your load balancer's backend service to use mTLS so thatthe load balancer can prove its identity to the backends. Thisauthentication is carried out using a client (load balancer) certificatethat the load balancer presents to the backend.
Certificate requirements
When configuring certificates for backend authenticated TLSand backend mTLS, ensure that they comply with these requirements:
Modern cryptography tools form the basis of mTLS authentication.Certificates must use either RSA or ECDSA algorithms for key exchange.Hashing algorithms must use SHA-256 or a stronger cryptographic hashfunction. Hashing algorithms such as MD4, MD5, and SHA-1 aren't supported.
Leaf server certificates that are provided by the backend have the followingrequirements:
- Thebasic constraintsextensionmust not contain
CA=true. - Theextended key usageextensionmust contain
serverAuth. - Theextended key usageextensionmust not contain the
codeSigning,timeStamping, orOCSPSigningfields. - The certificatemust not be expired.
- Thebasic constraintsextensionmust not contain
For leaf client (load balancer) certificates used in backend mTLS, thecertificate must be aCertificate Manager certificateresource. The scope of this certificatemust be
client-auth, which indicates that this certificate is used as aclient certificate in backend mTLS.- Thebasic constraintsextensionmust not contain
CA=true. - Theextended key usageextensionmust contain
clientAuth. - Theextended key usageextensionmust not contain the
codeSigning,timeStamping, orOCSPSigningfields. - The certificatemust not be expired.
- Thebasic constraintsextensionmust not contain
To authenticate the server certificates that your backend presents to theload balancer, the root and intermediate certificates that are located inthe trust config must meet the following requirements:
- Thebasic constraintsextensionmust contain
CA=true. - Thekey usageextensionmust be set to
keyCertSign. - Theextended key usageextensionmust contain the
serverAuthfield. - The certificatemust not be expired.
- Thebasic constraintsextensionmust contain
Key components of backend authenticated TLS and backend mTLS
Withbackend authenticated TLS, the load balancer can verify the identity ofthe backends that it connects to. You can configure backend authenticated TLS onan HTTP(S) load balancer that uses either HTTPS or HTTP/2 as its backend serviceprotocol. If you don't configure backend authenticated TLS, the load balanceraccepts any certificate from the backend. Usingbackend mTLS, you canadditionally configure the load balancer to present its own client certificateto the backend, which the backend can use to authenticate the load balancer.
To configure backend authenticated TLS, you need to do the following:
- Create a trust config resource.
- Create a backend authentication config resource.
- Update the TLS setting attribute on the backend service, pointing it to thebackend authentication config resource.
To configurebackend mTLS, you must create a client certificate and attach theclient certificate to the backend authentication config resource. Youcannot attach the client certificate after the backend authenticationconfig resource has been created.
The following diagram shows the different components, attached to the backendservice of an Application Load Balancer, that enable backend authenticated TLSand backend mTLS.
The information that follows provides an overview of these different componentsused to configure backend authenticated TLS and backend mTLS.
Trust config
To authenticate the server certificates that your backend presents tothe load balancer, the load balancer needs to be configured with X.509certificates that establish a chain of trust to the issuer of the backend'scertificate. You configure the trust config by using aTrustConfigresource,which expresses the entire trust config and contains a single trust store.
A trust store encapsulates a trust anchor (root certificate) and, optionally,one or more intermediate certificates. A trust anchor is a certificaterepresenting a root of trust. A valid server certificate must show a chain oftrust back to some trust anchor in the trust store.
An intermediate certificate is a certificate that is part of a chain of trustleading back to a trust anchor in the trust store. It is used, along with anyadditional intermediate CAs included with the leaf certificate, to build thetrust chain during the validation process. Creating an intermediate certificateis optional.
If you need to use a certificate that is self-signed, expired, doesn't chain toa specified root of trust, or has failed validation, you can add such acertificate to an allowlist in the trust config. Creating a self-signedcertificate that can be added to an allowlist is also optional.
The trust store doesn't contain any private keys because only the certificatesare necessary to verify a chain of trust.
Backend authentication config resource
The backend authentication config (BackendAuthenticationConfig resource) is attached to the backend serviceof the load balancer and performs the following functions:
- Enables backend authenticated TLS (backend authentication) by using thetrust config and the public roots of trust
- Additionally enables backend mTLS by using the client certificate
To enable backend authenticated TLS and backend mTLS, the backend authenticationconfig resource points to the following resources:
Trust config (
trustConfig):the attached trust config used to validate the server certificateprovided by the backend. The trust config isn't required whenthe backend authentication config uses the public roots of trustto validate the server certificate.Public roots of trust (
wellKnownRoots):indicates whether the load balancer trusts backend server certificates thatare issued by public CAs, in addition to certificates trusted by the trustconfig. To learn more, seeUse public roots of trust.Client certificate (
clientCertificate):the client certificate that the load balancer uses to express its identityto the backend, if the connection to the backend uses mTLS. For backendauthenticated TLS (backend authentication), this field can be empty, inwhich case the load balancer only authenticates the backend, but not itself,to the backend.
Backend service
Within the backend service, thetlsSettings attribute points to the followingresources in order to validate the backend certificate.
- Backend authentication config (
authenticationConfig) - SNI hostname (
sni) - Accepted SANs (
subjectAltNames)
The SNI (sni) and SAN (subjectAltNames) fields in thetlsSettings attribute control how the load balancer validates thebackend's certificate based on the certificate's SAN values. These fieldsinfluence the validation process regardless of whether backend authenticated TLSis configured.
When the SNI field is set (tlsSettings.sni),the load balancer does the following:
- Sends the SNI hostname to the backend server during the TLS handshake.
- Verifies that the backend's TLS certificate includes a SAN that matches theSNI hostname.
By default, the load balancer checks that the backend's TLS certificate includesa SAN that matches the SNI hostname. However, if SANs are configured on thebackend service (tlsSettings.subjectAltNames), the loadbalancer does the following:
- Ignores the SNI hostname for SAN verification.
- Verifies that the backend's TLS certificate includes a SAN thatmatches one of the accepted SANs (
subjectAltNames) configured on the backendservice.
Client certificate
In addition to backend authenticated TLS (backend authentication), you canconfigure a load balancer's backend service to use mTLS, so that the loadbalancer can prove its identity to the backend. This authentication uses aclient (load balancer) certificate that the load balancer presents to thebackend.
To configure backend mTLS, you need to do the following:
- Create a client certificate resource containing the client (load balancer)certificate and its private key.
- Attach the client certificate to thebackend authentication config resource.
Backend mTLS is also compatible withCompute Engine managed workloadidentities when you configure managedcertificates throughCertificate Manager. PublicPKI managed certificates aren't supported, and all client certificates musthave aclient-auth scope and comply withcertificaterequirements.
If the backend requests a client certificate, it must be configured to acceptthe client certificate. If the backend refuses the load balancer's connection,the load balancer returns an HTTP502 status code for requests that it'sproxying and logs a generic status to Cloud Logging.
Configure backend authenticated TLS and backend mTLS on the load balancer
You can configure backend authenticated TLS and backend mTLS on the load balancerusing either a private PKI or public roots of trust.
Use private PKI
The following is a high-level overview of the key steps that you need to followto configure backend authenticated TLS and backend mTLS on your load balancerusing certificates issued from your private PKI. Private PKI has the advantageof being fully under your control and isolated from the public internet's PKIsystems.
Create a trust config resource comprising the trust anchor (rootcertificate) and intermediate certificates that serve as roots of trust.
To configure backend mTLS, create a client certificate containingthe client (load balancer) certificate and its private key.
Create a backend authentication config resource that referencesthe trust config. If you want to configure backend mTLS,the backend authentication config resource referencesboth the trust config and the client certificate.
Attach the backend authentication config resource tothe backend service of the load balancer.
Note the following:
It is not possible to send a client certificate to the backendwithout configuring backend authenticated TLS first.
If you want to enable backend mTLS, you must create the client certificatebefore you configure the backend authentication config resource.
To learn more about this setup in detail, see the following guides:
Use public roots of trust
In addition to using certificates issued from your private PKI toenable backend authenticated TLS, you can also use public roots oftrust to validate the backend certificate.
To use public roots of trust, you don't need to create a trust config and attachit to the backend authentication config resource. Instead, you need to setPUBLIC_ROOTS as a value in thewellKnownRoots field of the backendauthentication config resource. Having said that,you can also create a trust config that explicitly includesthe roots of your publicly issued certificates,in addition to certificates trusted by the trust config.
ThePUBLIC_ROOTS setting uses a set of root CAs,similar to the set of root CAs trusted by browsers, that is managed by Googleand can change over time. This presents a risk of your backend certificatesbecoming invalid when these roots change. If you need to validatepublicly issued certificates, consider choosing a well-established andtrustworthy CA and one that uses intermediate cross-signing for issuing yourbackend certificates to mitigate the risk of a root certificate expiring orbeing revoked.
Server certificate validation steps
When validating the server certificate during backend authenticated TLS, orbackend authentication, the load balancer does the following:
Verify that the server possesses the certificate's private key.
The server proves possession of the private key associated with thecertificate it presents to the load balancer by signing a piece ofinformation using its private key and sending it to the load balancer as apart of the
CertificateVerifymessage. The load balancer then verifiesthis signature using the public key from the server's certificate. If thesignature verification fails, it indicates that the backend server doesn'tpossess the private key corresponding to the certificate. In such cases, theload balancer terminates the TLS handshake without logging any errors.Verify the chain of trust.
If the trust config includes at least one trust anchor or has the
wellKnownRootsattribute set toPUBLIC_ROOTS, the load balancer attemptsto verify a chain of trust between the server certificate and the configuredtrust anchor. The verification checks include the following:- The backend's server certificate, intermediate certificates (if provided), and the configured root certificate comply with thecertificate requirements.
- For all the certificates in the chain of trust, the subject field in the parent certificate matches the issuer field in the child certificate. This verification helps to ensure that the parent certificate's identity (subject) is the same as the identity listed as the issuer in the child certificate.
- For all the certificates in the chain of trust, the subject key identifier (SKID) of the parent certificate matches the authority key identifier (AKID) in the child certificate. This match confirms that the child certificate was issued by the correct root authority and that it can be trusted because the root's public key is being referenced in the AKID for verifying the certificate's validity.
Establish a connection with the backend.
If certificate validation succeeds, the load balancer proceeds with theconnection to the backend.
However, if the certificate validation fails, the load balancer terminatesthe connection to the backend, sends an HTTP
502status code to theclient, and logs the termination reason to Cloud Logging. In the event ofa certificate validation error, subsequent incoming requests trigger the loadbalancer to reinitiate the backend connection.The backend connection can also fail if the backend server refuses theconnection. Withbackend mTLS, this can happen because it finds the clientcertificate to be invalid. When the connection to the backend fails, the loadbalancer responds to proxied requests with an HTTP
502status code and logsa generic error reason to Cloud Logging.
Error handling and logging
Application Load Balancers provide detailed logging capabilities that allow youto monitor server certificate validation, identify potential issues, andtroubleshoot connection problems. This section outlines the different types oferrors that can occur during mTLS validation and how they are logged.
If the server certificate validation fails, the connection is terminated and theerrors are logged to Cloud Logging. These errors are described in thefollowing table.
| Server certificate status | Logged error |
|---|---|
| The server certificate chain is too long (more than 10 intermediate certificates included with the server certificate). | server_cert_chain_exceeded_limit |
A server or an intermediate certificate has an invalid RSA key size. No validation is performed. RSA keys can range from 2048 to 4096 bits. | server_cert_invalid_rsa_key_size |
A server or an intermediate certificate is using an unsupported elliptic curve. No validation is performed. Valid curves are P-256 and P-384. | server_cert_unsupported_elliptic_curve_key |
A server or an intermediate certificate is using a non-RSA or non-ECDSA algorithm. No validation is performed. | server_cert_unsupported_key_algorithm |
The PKI to be used for validation has more than ten intermediate certificates that share the same Subject and Subject Public Key Info. No validation is performed. | server_cert_pki_too_large |
An intermediate certificate provided for validation had more than 10 name constraints. |
|
The server certificate has an |
|
| The time limit is exceeded while attempting to validate the certificate chain. | server_cert_validation_timed_out |
The depth or iteration limit is reached while attempting to validate the certificate chain. The maximum depth for a certificate chain is ten, including the root and server certificates. The maximum number of iterations is 100 (certificates examined to validate the server certificate chain). | server_cert_validation_search_limit_exceeded |
You configured mTLS without setting up a | server_cert_validation_not_performed |
The server did not provide the requested certificate during the handshake. | server_cert_not_provided |
The server certificate failed verification with the | ssl_certificate_verification_failed |
Service is unable to perform certificate chain validation. | server_cert_validation_unavailable |
| Internal error validating certificate chain. | server_cert_validation_internal_error |
Matching | server_cert_trust_config_not_found |
| The server certificate payload (including any intermediate certificates) is too large (more than 16 KB). | server_cert_exceeded_size_limit |
Limitations
Backend authenticated TLS and backend mTLS isn't supported onclassic Application Load Balancers.
Backend authenticated TLS and backend mTLS isn't supported for the followingbackend types:
Global internet NEG backends
App Engine backends
Health checks used by backends don't implement TLS authentication or mTLScapabilities. You must configure the backends with health check endpointsthat can respond to HTTP or HTTPS requests.
The load balancer doesn't pass the client's SNI hostname from the frontendTLS connection when connecting to a backend. However, backends can accessthe client's SNI hostname using acustom request header.
For backend mTLS, the client certificate keys are restricted to thefollowing:
- RSA keys can range from 2048 to 4096 bits.
- ECDSA keys can use the P-256 or P-384 curves.
Backend authenticated TLS doesn't support certificate revocation checks.
Quotas and limits
A single trust store can hold up to 200 trust anchors and intermediatecertificates combined, with a separate limit of 100 for intermediatecertificates. No more than three intermediate certificates can share thesame Subject and Subject Public Key information.
The maximum depth of a certificate chain is 10 certificates, including theroot and leaf certificates. The maximum number of intermediate certificatesthat can be evaluated while attempting to build the chain of trust is 100.
Backend authenticated TLS limits the certificate chain received from thebackend to no more than 16 KB and 10 certificates.
Root certificates used for validation cannot contain more than 10 nameconstraints.
The maximum number of subject alternative names allowed in the
tlsSettings.subjectAltNames[]field is 5.
What's next
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.