OpenBao TLS certificate authentication behind a reverse proxy

How to authenticate machines to OpenBao with client certificates when a load balancer or reverse proxy terminates TLS, and which settings, versions and checks decide whether logins work.

On this page

When OpenBao TLS certificate authentication fits a machine fleet

The TLS certificate auth method lets a client present an X.509 certificate that OpenBao validates against CAs you have trusted on the certs path, so a machine can log in without a platform identity or a stored password. Behind a load balancer or reverse proxy that terminates TLS, there is one extra step: the proxy must hand the client's leaf certificate to OpenBao, or the login has nothing to validate. Before you design around this, confirm in the OpenBao auth methods documentation which methods your target version supports and how each one expects to receive identity.

The auth methods documentation lists AppRole, JWT/OIDC, Kerberos, Kubernetes, LDAP, RADIUS, TLS certificates, tokens, and username and password, plus login MFA. It recommends Userpass for developer machines and AppRole for servers. For a server fleet, that guidance points teams toward AppRole first, since it uses role and secret IDs that you can scope, rotate and wrap. Certificates still make sense when your estate already issues machine certificates from an internal CA, when hosts have certificates managed by configuration tooling, or when you want login to depend on possession of a key rather than a delivered secret. Confirm with the docs whether the TLS method meets your audit needs before choosing it over AppRole.

Choose certificates when you can answer three questions yes: can your CA issue and renew machine certificates on a schedule your hosts can follow, can you restrict which certificates count as client certificates, and can your proxy pass the leaf certificate through reliably. If any answer is no, AppRole or another method is likely the simpler path. Ask your team to list the CAs and certificate profiles that would be trusted, and ask the proxy owner how client certificate verification is configured on the edge. Those two lists define the scope of the design before you configure anything in OpenBao.

Configuration options for certificate login and when each fits

This table compares the three ways a client certificate can reach OpenBao: direct TLS, a proxy that forwards the leaf certificate, and a proxy that terminates TLS without forwarding. Read each row against your own answer to who must hold the private key and where certificate verification has to happen. Confirm exact option names and proxy settings in the OpenBao TLS certificate auth documentation before you write configuration.

OptionWho holds the client key and where verification happensTrade-offs and what the proxy must be trusted forWhen it fits
Direct TLS with client certificate verificationThe client presents its certificate to OpenBao itself, and OpenBao checks the chain against trusted CAs on the certs pathNo proxy in the trust path, so the fewest components to trust. Load balancers must pass TLS through without terminating it.Single-node or small clusters where the load balancer can pass TLS through and no proxy sits in front
Proxy terminates TLS and forwards the leaf certificateThe proxy validates the client chain, then passes the leaf certificate to OpenBao in a forwarded header (2.6 and later)OpenBao relies on the proxy's verification and on the header being set only by that proxy. Confirm the header name and trusted proxy settings in the docs.Clusters behind an ingress or load balancer that must terminate TLS, on OpenBao 2.6 or later
Proxy terminates TLS with no forwardingThe proxy verifies the client, but OpenBao receives no certificate, so it cannot check the identity itselfLogin by certificate fails or depends on a trust assumption the proxy cannot give OpenBao. Usually a poor fit for certificate auth.Rarely a good choice for certificate login. Use it only for other auth methods that the proxy's identity can support
Trusted CA bundle on the certs pathOperators list the CA certificates OpenBao will accept for client chains, at the path the TLS certificate method readsA narrow bundle limits who can authenticate. Include intermediate CAs only when your chain requires them, and rotate the bundle when CAs change.Any option that verifies client chains inside OpenBao
Role-level constraints (allowed names and attributes)Each role states which certificate names or attributes it accepts, on top of chain trustRoles narrow access after chain validation. Overly broad names weaken the control, so write constraints per machine group.Separate roles per workload class, such as build agents and application servers
ClientAuth extended key usageClient certificates must carry the ClientAuth extended key usage, or the TLS handshake and login will reject themCertificates issued without this usage fail with confusing errors. Check it in your issuing CA profile before rollout.Every client certificate used for login, including those issued by an internal PKI
Where the proxy must be trustedThe proxy vouches for the chain or the forwarded certificate, depending on the option chosenRestrict which hosts can reach OpenBao directly and which can set forwarded headers. A spoofed header defeats verification.Forwarding options only, combined with network controls that block direct access
Private key custodyClients keep their private keys locally or in a hardware-backed store, and the proxy or OpenBao never holds themKeys stay with the workload in every option, but proxy-terminated TLS adds a copy of session keys on the proxy. Confirm where proxy keys are stored.Teams with strict key custody rules that must review every component holding key material
Operational checks before go-liveTest login from each client type, after proxy restarts, and after CA rotationFailures often appear only after certificate renewal. Run a renewal test on the exact chain your clients will present.Before moving any production workload to certificate login

How a client certificate travels from the machine to the OpenBao login

The flow starts at the client machine, which presents its leaf certificate during the TLS handshake with the reverse proxy. The proxy terminates TLS and must forward that leaf certificate to OpenBao in a request header, because OpenBao only sees the proxy's connection. OpenBao then checks the certificate chain against the CAs trusted on the cert auth path, and on success issues a token. The trust boundary between proxy and OpenBao is where a misconfigured forwarding header causes a rejected login, so confirm both sides before going live.

Client certificate path from machine through proxy to OpenBao token issuance.

Why the proxy must forward the leaf certificate

When a reverse proxy or load balancer terminates TLS, OpenBao never sees the client's handshake, so it cannot inspect the client certificate that the machine presented. The proxy has already validated the connection, and the only evidence OpenBao receives is what the proxy chooses to send along. For certificate authentication to work, the leaf certificate has to be copied into a request header that OpenBao is explicitly configured to read. If that header is missing, OpenBao sees an unauthenticated request and the login fails, which is why this section belongs in the design before any client is enrolled.

Forwarding support depends on the OpenBao version. The forwarding behavior described here applies to OpenBao 2.6 and later, so teams on that line or newer should plan the proxy configuration against those releases. Teams still on the 2.5 line should note that the renewal fix in 2.5.3 matters for certificate logins that must keep working over time, and should weigh that fix before deciding whether to stay on 2.5 while they plan a move. Check the OpenBao releases page for the full version history and the exact patch level you intend to run. Do not assume a later release fixes or adds something without confirming it in the release notes.

Before you build anything, confirm the header name, the format the proxy uses to encode the certificate, and the trusted proxy settings in the OpenBao documentation for your version. Then confirm the matching directive in your proxy vendor's documentation, because a proxy may strip, rename or re-encode headers by default, and a client can often spoof a header that reaches OpenBao unchanged. Treat the proxy as part of the trust boundary: only the proxy should be able to set the header, and OpenBao should accept it only from that proxy's address. Test this path end to end with a real client certificate and a revoked one before go-live.

Setting up certificate login behind a reverse proxy, step by step

This sequence takes a cluster from no certificate login to a tested setup where OpenBao accepts client certificates only from the CAs you trust and only when your TLS-terminating proxy passes the certificate through. Each step ends with a check you can run before moving on.

  1. Confirm OpenBao version and method

    The platform team checks that every node runs the same OpenBao release, and that the release includes the TLS certificate auth method and proxy forwarding behavior you plan to use. The topic scope places forwarding support in the 2.6 line and later, and the renewal fix in 2.5.3. Confirm these against the release notes before you rely on them. Run bao version on each node, then enable the cert method at the path you intend to use and run bao auth list to confirm it appears. This step is done when every node reports the same version and the method is listed.

  2. Decide trust model and CA bundle

    The security team decides which certificate authorities may sign machine identities, whether one CA covers all environments or each environment has its own, and who owns the bundle. Collect the PEM certificates for those CAs, including any intermediates needed to build the chain. Keep the bundle to the CAs you actually intend to trust. The same trust decision must apply at the proxy, because the proxy also verifies client certificates before forwarding them. Check that each certificate in the bundle parses and that its subject matches the CA you expect. Write down the owner and the process for adding a CA later.

  3. Issue client certificates with ClientAuth

    The PKI or platform team issues a client certificate for each machine identity from an approved CA. The leaf certificate must carry the extended key usage for client authentication, often called ClientAuth, and should have a subject or subject alternative name that identifies the machine uniquely. Choose a lifetime that matches your rotation process. Inspect a sample with openssl x509 -in client.pem -noout -text and confirm the extended key usage lists client authentication. Test that a certificate without that usage is rejected at login. This step is done when a correctly issued certificate is accepted by the test and an incorrectly issued one is not.

  4. Create the certs role

    The OpenBao administrator creates a certs role on the auth path from step one. The role binds the trusted CA certificate, restricts which certificate names may log in, attaches the policies that the machine needs, and sets token lifetime limits. Keep the constraints narrow, because a broad name match lets any certificate from the bound CA obtain those policies. Confirm the exact configuration keys for your version in the TLS certificate auth documentation, since names and behavior differ between releases. Read the role back to confirm the constraints, policies and TTLs are what you intended. Then log in with a matching test certificate, directly and not through the proxy, and confirm a token with the expected policies is returned.

  5. Configure proxy to forward certificate

    The network or platform team configures the TLS-terminating proxy to request a client certificate, verify it against the same CA bundle used by OpenBao, and forward the leaf certificate to OpenBao in the header that your OpenBao version expects. The proxy must remove any client-supplied copy of that header on incoming requests, so a caller cannot inject its own value. Confirm the header name and encoding in the documentation for your release and proxy product. Check the configuration with the proxy's syntax check, then send a request with a valid test certificate and inspect the forwarded header at the OpenBao listener or in proxy logs. Done when the header carries the test leaf certificate.

  6. Configure OpenBao to trust proxy

    The OpenBao administrator tells the server which proxy addresses may supply the forwarded certificate and which header to read, matching the proxy configuration. This trust setting is what stops a caller that reaches OpenBao directly from presenting a certificate in a header it created. Restrict the trusted addresses to the proxy's real egress or internal addresses and avoid broad ranges. Restart or reload according to your procedure, then verify the change on every node. Check that a login sent directly to OpenBao with a forged forwarding header is rejected, and that the same login through the proxy succeeds.

  7. Test logins from a test machine

    A test machine that holds a valid client certificate logs in through the proxy and records each result. Run four cases: a valid certificate from the trusted CA, which should succeed and return a token with the role's policies; a certificate issued by an untrusted CA, which should be rejected; a request where the proxy does not forward the header, which should be rejected; and an expired certificate, which should be rejected. Run each case with the same CLI or API call your automation will use. The setup is ready to hand to the team that owns the machine only when all four outcomes match what you expected and the results are saved with the configuration.

Security risks in certificate login through a proxy

Certificate login through a reverse proxy moves trust from the client to every hop between the client and OpenBao. The cards below cover where that trust can break, the control to apply at each point and what to verify before the path goes to production.

Untrusted CAs accepted at the proxy

If the proxy accepts client certificates signed by any CA it trusts, a machine holding a certificate from an unrelated issuer can reach the login path. Limit the proxy's client CA bundle to the internal CA that issues machine certificates, and keep OpenBao's trusted CAs on the TLS auth certs path aligned with that same bundle. Verify both by presenting a certificate from a different CA and confirming that login fails at each layer.

Spoofed forwarding headers

When the proxy passes the client certificate to OpenBao in a header, any client that can reach OpenBao directly can send that header itself. Block direct access to OpenBao from client networks so that only the proxy can open the connection, and make the proxy overwrite any forwarded certificate header it receives from clients. Test by sending a crafted header straight to the OpenBao listener and confirming it is rejected.

Certificates without ClientAuth usage

A certificate issued for server use or for a general purpose may carry no ClientAuth extended key usage, and some clients or proxies will still present it. Set the issuing template to include ClientAuth only for machine login identities, and keep server and client templates separate. Check the issued certificate's extended key usage field before any role is bound to it.

Long-lived client certificates

A login certificate with a multi-year lifetime and no renewal process becomes a standing credential that is hard to revoke in practice. Set a short validity period, automate reissuance on each host, and define what happens when a certificate is compromised, including how the affected role is disabled. Ask the team owning the internal CA which renewal mechanism they will use and how revocation status is checked.

Private key handling on machines

The private key is the login secret, so a copy left on disk with broad read access lets any local user authenticate as the machine. Restrict the key file to the service account, avoid world-readable permissions and keep keys out of shared images and backups where possible. Verify file modes and ownership on each host, and confirm the process that reads the key is the only one that needs access.

Audit gaps at the proxy address

When requests reach OpenBao from the proxy, the audit log may record the proxy's address instead of the client's, which makes it hard to tell which machine logged in. Confirm how the proxy passes the original client address and how OpenBao is configured to read it, and test that audit entries identify the calling host. Review a sample login in the audit log before relying on it for investigations.

OpenBao auth docs

How the proxy setup differs by environment

A managed cloud load balancer is usually the least configurable layer in the path. The provider decides which TLS options exist, whether client certificate verification can be enabled, and whether the leaf certificate is passed to the backend at all. Many managed offerings present only a subset of what a self-managed proxy can do, so the first task is to read the provider's current documentation for mutual TLS and certificate forwarding rather than assuming it matches what you need.

  • Mutual TLS support: Confirm that the listener can request and verify client certificates, and which trust store it uses for that check.
  • Leaf certificate forwarding: Confirm whether the full client certificate can be passed to the backend, and in what format and header.
  • Header behavior: Confirm the header names, whether they are added or can be overwritten by clients, and whether they are stripped from inbound requests.
  • Certificate ownership: Confirm who issues and rotates the proxy's server certificate and who issues client certificates, since the provider may own one but not the other.
  • Logging and limits: Confirm what the provider logs about client certificate handshakes and whether any per-request size or header limits apply.

Before relying on the setup, check each provider's documentation and your own OpenBao version, then test a real certificate login end to end.

Limits to confirm before you commit to this design

TLS certificate authentication behind a reverse proxy depends on the OpenBao version, the proxy's behavior and how certificates are managed over time. Confirm each item below in your own environment before you approve the design, because any one of them can change the build.

OpenBao version against forwarding support

Forwarding the client's leaf certificate from a TLS-terminating proxy is supported from OpenBao 2.6 onward, and the renewal fix arrived in 2.5.3. Confirm which minor line and patch level you will run, and whether your upgrade path lands on a release that includes both. If you are on an earlier 2.5.x patch, plan the upgrade before relying on certificate renewal. Check the version on every node in the cluster, not only the one you tested.

OpenBao releases

Proxy certificate forwarding format

Confirm that your reverse proxy can forward the client's leaf certificate to OpenBao in the form OpenBao expects, and that the proxy passes it only from clients that completed the TLS handshake. Test with the exact proxy product and version you plan to run, since header names, encoding and whether the chain is included vary by product. Ask the proxy vendor how it handles a missing or malformed client certificate, and make sure OpenBao does not trust a forwarded header from any other source.

Client certificate rotation process

Machines that authenticate with certificates need a rotation path that does not break logins. Confirm who issues the client certificates, how long they are valid, and how new certificates are added to the trusted CAs on the certs path before old ones expire. Check that the certificate carries the ClientAuth key usage and that rotation is rehearsed on a non-production role. Without a documented overlap window, a single expired certificate can stop a production service.

Impact on existing logins

If you are moving from Vault or from another auth method such as AppRole or Kubernetes auth, confirm how existing tokens, roles and entity aliases behave after the change. Migration guidance covers replacing the Vault server process with configuration unchanged, but that guide was tested only against Vault 1.14.1 community edition. Inventory which workloads log in by certificate today, run them against the new configuration in staging, and confirm the policies they receive still match.

Migration guide

Failure path testing

Plan tests for the cases that fail quietly: an expired client certificate, a certificate signed by an untrusted CA, a proxy that is down or misconfigured, and a forwarded certificate that arrives without its chain. For each case, confirm the expected denial, the audit log entry it produces and the alert that reaches your operations team. Also confirm what happens during a leader change on a multi-node cluster, since the proxy and the active node must agree on which requests carry the certificate.

Questions buyers ask about certificate auth behind a proxy

How much effort does certificate auth behind a reverse proxy take?

The effort depends mostly on the proxy setup, the number of machines that will log in, the state of your existing PKI, and how much testing you require. A single proxy forwarding the client certificate to one OpenBao cluster with an internal CA is a bounded job. Effort grows when several proxies or load balancers sit in front of the cluster, when machines come from many environments with different certificate chains, or when the CA needs cleanup before it can be trusted for login. Ask for a written scope that lists each proxy, each CA, the machine groups and the test cases, because those items set the work. No duration figures are given here; the quote should state the effort in your environment.

Can our team set up certificate auth behind a proxy without outside help?

Yes, a team with proxy administration skills and PKI experience can usually do a single proxy and a small CA without outside help. The hard parts are the forwarding header configuration, confirming that the proxy passes the leaf certificate and not only a verification result, checking that the certificates carry the ClientAuth key usage, and testing renewal before the first certificate expires. Outside help is more useful when there are many environments, several CAs, strict audit expectations or a short window for the cutover. Decide early which steps your team owns and which need a second pair of hands, and write that split into the plan.

What do we need to provide before the work starts?

Plan to provide four things. First, access to the reverse proxy or load balancer configuration, including the ability to change how client certificates are forwarded. Second, ownership or a clear owner of the CA that signs the machine certificates, with its chain and its revocation approach. Third, a test fleet of representative machines, so renewal and login can be tested on real hosts rather than only in a lab. Fourth, decisions on the OpenBao version. Versions 2.6 and later support forwarding the leaf certificate from a TLS-terminating proxy, and version 2.5.3 includes the renewal fix, so the target version determines the proxy design. Confirm these items with your team before scoping.

How long will the work take, and what changes the timeline?

No timeline figures are supplied for this topic, so the right answer comes from a written scope for your environment. Timelines move with the number of proxies and clusters, how many machine groups need certificate login, whether the CA is ready, how long change windows and approvals take in your organization, and how much renewal testing is required before cutover. Ask the provider to break the schedule into discovery, proxy configuration, CA and role setup, a test fleet phase, and handover, and to state which of your own reviews sit on the critical path. A schedule without those dependencies is not a basis for planning.

Is AppRole a better fit than certificates for most servers?

For most servers and pipelines, AppRole is the simpler fit, and OpenBao's documentation recommends AppRole for servers. AppRole works without the proxy forwarding work, and its secret ID settings can be limited in time and use count and delivered with response wrapping. Certificate auth fits best when your organization already issues strong machine certificates from an internal CA, when you want login tied to the identity of the machine itself, or when a platform cannot easily hold a secret ID. Make the choice per workload group, not for the whole estate, and record the reason for each one so auditors can follow it.

What should a written quote for this work include?

A useful quote lists the scope in concrete terms. Include the proxies and load balancers in scope, the OpenBao version and the minimum version needed for leaf certificate forwarding, the CA certificates to be trusted on the certs path, the certificate key usage requirements, the machine groups and role definitions, and the renewal test plan with the 2.5.3 fix in mind. Also include the deliverables, such as configuration files, runbooks and test records, the client responsibilities from the previous question, the change and rollback approach, and the handover. Finally, ask which costs are one-time and which recur, such as ongoing support or upgrades, and what is excluded.

How DeployOpen scopes and delivers certificate auth work

DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own infrastructure, including OpenBao TLS certificate authentication behind a reverse proxy. We agree the scope, trust chain, proxy configuration and handover deliverables in writing before any build work starts.

How we scope

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work begins.
  • We confirm which machines authenticate with certificates, which CAs they chain to, and which roles each certificate maps to.
  • We confirm your reverse proxy product and version, and whether it can forward the leaf certificate to OpenBao in your environment.

How we build

  • We configure trusted CAs on the certs path and set ClientAuth key usage on issued client certificates.
  • We configure the TLS-terminating proxy to forward the leaf certificate, and confirm the forwarding header is accepted only from the proxy.
  • We test certificate renewal and rotation on the OpenBao version you run, including the fix introduced in 2.5.3.

How we hand over

  • You receive documented CA trust settings, role definitions, proxy configuration and the verification steps used during testing.
  • You receive a runbook covering certificate renewal, CA rotation and how to troubleshoot failed client certificate logins.
  • Handover sessions walk your platform and security teams through the configuration so they can review and maintain it.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, covering OpenBao version changes that affect certificate login.
  • We retest authentication paths after proxy upgrades, CA changes and OpenBao version upgrades in your environment.
  • Security testing of the auth configuration, including the proxy and trust chain, can be scoped as a separate engagement.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.