Mutual TLS Between a Portal and App Servers

Published 2026-11-29 · Updated 2026-11-29 · 8 min read · Sora Panel team

Mutual TLS, or mTLS, lets a portal and an application server authenticate each other at the transport layer. In a conventional TLS connection, a client validates the server certificate. With mutual authentication, the server also requests and validates a client certificate. Each side must prove possession of the corresponding private key; simply presenting a certificate is not enough.

That handshake establishes a protected channel and an authenticated peer identity. It does not establish whether a particular operation is permitted, whether a host is healthy, or whether an instruction is safe. For a hosting control plane, the practical design question is how a certificate identity is enrolled, checked, mapped to a managed server, and eventually replaced or removed.

Illustration: two server identities establishing a trusted connection
Illustration, not a product screenshot.

Draw the connection and trust boundaries

A common arrangement is an agent on each app server that opens an outbound connection to a control portal. The agent acts as the TLS client and validates the portal's server identity. The portal validates the agent's client certificate before accepting its connection. Which side initiates the connection is a network decision; mTLS can authenticate both peers regardless of who initiates it.

Draw the actual path, including DNS, proxies, load balancers and any service that terminates TLS. If a proxy terminates the connection, the portal does not directly see the original TLS peer unless a separate, protected mechanism conveys that identity. Decide which component validates the certificate and how its verified identity reaches the authorization service. Never trust a client-supplied identity header merely because it has a familiar name.

Outbound connections may reduce the need to expose an agent listener, but they do not eliminate egress policy, DNS or control-plane availability considerations. A host must still reach the portal, and an attacker controlling that host may be able to use credentials available there. Consider the entire route rather than treating the arrow in a diagram as an access policy.

BoundaryQuestionEvidence to check
Agent to portalIs this the intended portal?Trusted chain, expected server name and certificate validity
Portal to agent identityIs this an enrolled host?Trusted client issuer, certificate purpose and registered identity
Request authorizationMay this identity act on this target?Policy decision tied to the resource and operation
LifecycleCan trust be changed safely?Successful renewal, revocation and recovery exercises

Validate identity, not just encryption

Encryption without peer verification can protect a connection to the wrong endpoint. The agent should validate the certificate chain against its configured trust anchors, check validity dates and compare the expected portal name with the certificate identity using its TLS implementation's normal hostname verification. Avoid disabling name or chain verification to make a connection work; diagnose the actual trust, name or clock problem instead.

The portal needs its own client-certificate validation policy. Accepting any certificate from a broad, unrelated trust store is not the same as recognizing an enrolled agent. Establish which issuing authority may issue client certificates, require an appropriate client-authentication purpose, and define how a verified certificate identity maps to a single managed server or other deliberately scoped principal. Reject expired certificates and identities that have been decommissioned even if a cryptographic chain still validates.

Protect the root and issuing keys according to the harm they can cause. An issuing authority that can mint agent identities is a high-value administrative system, not an ordinary application secret. Keep private keys out of logs and tickets, restrict access to enrollment, and maintain an inventory linking each certificate to its owner, purpose, issuer and expiration. Prefer a distinct identity per host over a shared certificate that makes individual removal and attribution difficult.

Enrollment is often the most sensitive transition. A bootstrap credential must be delivered through a trusted route, bound to the intended host and removed or expired after use. Define how an operator recognizes a legitimate replacement host, rather than allowing an unverified machine to claim an existing identity. A certificate proves possession of a key; the enrollment process establishes why that key should represent a particular machine.

Keep authorization separate from the handshake

After authentication, evaluate the requested action against the registered identity, target and current policy. A certificate may establish that a connection came from a particular agent, but it should not grant that agent authority over every site or organization. Likewise, a portal-to-agent command needs its own allowed operation, parameters and target checks. Scope sensitive access to the minimum needed for the job.

Consider the full chain of authority: a human or service requests an action, the portal evaluates permissions, and an agent executes a bounded operation. Preserve the requester's identity and any required approval along with the resulting job. A successful TLS handshake is not evidence that a requested deployment or configuration change succeeded. Record success, failure and uncertain execution outcomes separately, without logging private keys or bearer credentials.

Test boundaries with authorized disposable hosts. An unknown client certificate should fail; an enrolled but disabled identity should fail; a valid identity should not act on an unrelated server. Also test a wrong portal hostname and a certificate from an untrusted issuer. Include reconnects after permission changes so that a long-lived connection does not accidentally preserve rights that policy has withdrawn.

Plan certificate rotation before expiry

Public certificate rules illustrate why manual certificate handling is a fragile long-term dependency. The CA/Browser Forum TLS Baseline Requirements, section 6.3.2 set a staged maximum validity for publicly trusted TLS server certificates, shown below. These are issuance-date thresholds, not a requirement to invalidate existing certificates at each threshold.

Public TLS server certificate maximum validity

Maximum for certificates issued in each period

  • Before 15 March 2026
    398
  • From 15 March 2026
    200
  • From 15 March 2027
    100
  • From 15 March 2029
    47
SC-081's public TLS server certificate schedule; private mTLS client certificates are outside its scope. Maximum validity at issuance; existing certificates are not retroactively shortened. Source: CA/Browser Forum TLS Baseline Requirements 2.3.1, §6.3.2, viewed 2026-11-29.
View chart data
ItemdaysNote
Before 15 March 2026398
From 15 March 2026200
From 15 March 2027100
From 15 March 202947

Scope matters: SC-081 covers public TLS server certificates, not private mTLS client certificates or private certificate authorities. Their lifetimes are set by the private PKI's own policy. The schedule is nevertheless a useful reminder to automate issuance and replacement for both public server certificates and private client identities, without assuming the same legal or technical rule applies to each.

Inventory certificates and alert well before expiry, including the portal certificate, client certificates, intermediate issuers and trust anchors. Automate renewal where possible, verify the replacement identity and purpose, install it atomically, and confirm that the process actually reloads it. Issuing a new certificate on disk does not prove the running service is using it. Alert on failures and on certificates that should have renewed but have not.

Rehearse the difficult case: an agent is offline during rotation, then reconnects after its old certificate has expired. Decide how the host regains trust without silently bypassing verification. For a planned CA change, distribute and verify the new trust anchor before switching issuers; remove old trust only after the fleet is accounted for. Overlap must be controlled and time-bounded, not an excuse to trust every issuer indefinitely.

Respond to compromise and verify recovery

If an agent private key may be exposed, disable the corresponding registered identity promptly, investigate the host and issue a new key only after the trustworthiness of the replacement is established. Certificate revocation helps only where the relying party actually checks and enforces status; document the mechanism your deployment uses, including what happens when the status service is unavailable. Short lifetimes reduce the window of a stale credential but do not replace an emergency disable path.

If an issuing key is compromised, the response has a wider scope: identify potentially affected certificates, stop trusting the compromised issuer, replace the issuing chain and distribute new trust safely. An ordinary leaf-certificate renewal is not enough. Keep an independently reachable recovery procedure and named owners for CA operations, portal configuration and host enrollment.

Run a tabletop exercise with a lost host, a failed renewal and a compromised issuer. Record detection, containment, restoration and evidence, including who can make each decision. Review service availability and the blast radius of each trust decision rather than assuming mTLS alone makes the control plane safe.

RFC 8446 describes the TLS handshake and optional client authentication. The server requests a client certificate when the deployment requires it; the application still needs its own policy for mapping that verified identity to a host. At a TLS-terminating reverse proxy, consult the nginx client verification documentation: its verification setting and trusted CA configuration are distinct from the application's resource authorization. Check the effective configuration and protect any identity information passed onward.

ACME, specified in RFC 8555, provides a protocol for automating certificate issuance, identifier validation and revocation. It can support public server certificate renewal, but successful issuance alone does not verify installation, service reload or the private client-certificate enrollment policy. Monitor each of those steps independently and rehearse recovery when an automated challenge fails.

For adjacent controls, see evaluating agent permissions and audit trails for changes. Sora Panel is not released yet; read how it works and explore the Guides.

Frequently asked questions

Does mTLS authorize every request?

No. It authenticates peers and protects the connection; an application must separately authorize each action and resource.

Does the public TLS validity schedule govern private client certificates?

No. The SC-081 schedule covers publicly trusted TLS server certificates. Private client certificates follow the private PKI's policy.

Can an outbound agent connection replace access control?

No. Network direction can reduce exposed listeners but does not replace identity checks, authorization or credential management.

What should happen when an agent key is compromised?

Disable the identity, investigate the host and replace its key and certificate through a trusted enrollment process. Enforce revocation where configured.

Sources

Sora Panel is not released yet. Read how it works on the homepage.