Which SSL Certificate for app.example.com and api.example.com?
App and API subdomains often grow side by side. Learn how single, wildcard and multi-name certificates differ and how to pick the one that fits your setup.
10 min readUpdated Nov 20, 2026By XPASS Editorial Team

Almost every web product ends up with more than one hostname. The marketing site lives at example.com, the web application at app.example.com, the programming interface at api.example.com, and sooner or later a staging copy, a status page and a dashboard appear as well. Each of these needs HTTPS, and each needs a certificate that the browser or the API client accepts for that exact name. The question is whether you should buy one certificate per name, one certificate that covers every subdomain, or one certificate that lists several names explicitly.
This guide walks through how certificates match hostnames, the three realistic options for an app and API pair, and a simple way to decide. It also covers the practical details that cause outages: renewals, private key handling, validation and clients that behave differently from browsers. If you want to compare the wildcard route in more depth, read whether a Wildcard SSL is worth it for many subdomains, and for the explicit-list route see what a SAN certificate is.
How a certificate decides which hostnames it covers
A TLS certificate is a signed statement that a public key belongs to certain names. Modern clients read those names from the Subject Alternative Name (SAN) extension defined in the X.509 profile (RFC 5280). When your browser opens https://app.example.com, it checks that the hostname in the address bar appears in the SAN list, either exactly or through a wildcard pattern. If it does not, you see a name mismatch warning, no matter how valid the certificate is in every other respect.
This matching is strict and literal. A certificate for example.com does not cover app.example.com. A certificate for app.example.com does not cover api.example.com, and it does not cover the root domain either. The certificate also says nothing about ports or paths, so the same certificate works on port 443 and on port 8443 as long as the hostname matches. Three consequences follow:
- Every hostname your users or your code connect to must be on the certificate that the server presents for that name.
- Adding a new subdomain later means either issuing a new certificate or reissuing an existing multi-name one.
- A wildcard is the only way to cover names that you have not decided on yet.
Keep in mind that the certificate answers a question about identity, not about content. HTTPS with a valid certificate means the connection is encrypted and the hostname matches. It does not say that the application behind it is well built. See the HTTPS explainer if you want a broader refresher.

The three options for an app and API pair
For app.example.com and api.example.com you can choose among three structures. All of them are valid, and each has a typical situation where it fits best.
Option 1: one single-name certificate per hostname
You request a separate certificate for app.example.com and another for api.example.com. Each server holds only its own certificate and key. The advantage is isolation: a leak of the API server key does not expose the key of the web app, and you can renew, revoke or replace each certificate on its own schedule. The disadvantage is administration. Two hostnames mean two renewals, three hostnames mean three, and a team that forgets one expiry date gets an outage on exactly that service.
Option 2: one wildcard certificate
A wildcard certificate for *.example.com matches any single label in front of example.com, so app.example.com, api.example.com, staging.example.com and status.example.com are all covered by the same certificate. You install it on every server that terminates HTTPS for those names. It is the lowest-maintenance choice for a growing set of subdomains. The costs are that all those servers share one private key, that wildcard issuance normally requires validating control of the domain through DNS rather than through a file on a web server, and that it will not cover nested names such as eu.api.example.com.
Option 3: one multi-name (SAN) certificate
A multi-name certificate lists each hostname explicitly: for example example.com, app.example.com and api.example.com. Because the list is explicit, it can even mix unrelated domains. It is a good fit when you have a small number of fixed names that you want to manage under one renewal. The limit is that each change to the list means a reissue, and providers set a maximum number of names per certificate. The topic is explored in detail in SAN SSL for multiple hostnames.
| Factor | Single name per host | Wildcard | Multi-name (SAN) |
|---|---|---|---|
| Covers a new subdomain without reissue | No | Yes, one level only | No, reissue needed |
| Number of renewals to track | One per host | One | One |
| Key isolation between servers | Strong | Weak if shared | Weak if shared |
| Validation method | Usually any | Usually DNS-based | Usually any |
| Best for | Few hosts, strict separation | Many or changing subdomains | Small fixed list |
Choosing between them: a short decision path
Work through the questions below in order. They take a few minutes and usually lead to a clear answer.
- List every hostname that must be secured today: root domain, app, api, admin, staging, status page and so on. Write the real list rather than guessing.
- Estimate how many names you will add in the next year. If the answer is "several, and I do not know which", lean towards a wildcard.
- Decide whether the servers are managed by the same team and sit in the same trust zone. If the API is run by a separate team or vendor, a shared private key is a bad idea; prefer separate certificates.
- Check whether any name sits two levels below the domain, such as eu.api.example.com. A single wildcard will not cover it, so you need an additional certificate or a multi-name one.
- Check whether you can complete DNS-based validation. If your DNS provider offers an API or you can add a TXT record by hand, a wildcard is workable. If you cannot touch DNS, a single or multi-name certificate with another validation method may be easier.
- Decide who is responsible for renewal. Whatever you choose, assign a person or an automated process and set a reminder well before the expiry date.
For most small products with an app, an API and a marketing site, the choice comes down to a wildcard (if more subdomains are coming) or a three-name SAN certificate (if the list is stable). A pair of single-name certificates is the right choice when the app and the API belong to different teams.
A worked example
Imagine a small team that sells a scheduling tool. Their names are example.com for the website, app.example.com for the web client and api.example.com for the programming interface used by the mobile app and by customers' scripts. A year from now they plan to add docs.example.com and a regional endpoint.
Option A, a three-name SAN certificate: they list example.com, app.example.com and api.example.com. It works at once and renews as one unit. When docs.example.com appears, they reissue the certificate with a fourth name and deploy it everywhere. If they forget the deploy on one server, that server keeps serving the old certificate, and docs.example.com fails there with a name mismatch.
Option B, a wildcard certificate that also includes the bare domain: they request *.example.com plus example.com in the same certificate (many providers support this combination, so confirm it). The same certificate serves the website, the app, the API and the later docs site without any reissue. The trade-off is that the private key now sits on every server that serves those names, so access to that key must be tightly controlled.
Option C, separate certificates: the web server holds one for example.com and app.example.com, and the API gateway holds its own for api.example.com. The key for the API never leaves the gateway. This costs one extra renewal but is the cleanest arrangement if the API is exposed to partners and has its own operations team.
There is no universally correct answer. The point of the example is that the same product can reasonably choose any of the three, and the deciding factors are growth, ownership and key handling rather than the app and API labels themselves.
Validation and issuance details
Public certificate authorities must confirm that you control the domain before issuing. The rules are set jointly by browsers and authorities in the CA/Browser Forum baseline requirements. For most app and API use cases a Domain Validated (DV) certificate is sufficient. Organization Validated (OV) and Extended Validation (EV) certificates add checks of the company identity, but modern browsers no longer show the company name prominently in the address bar, so the visible benefit for an API is small. Some customers and procurement teams still ask for OV, so check what your contracts require.
The usual DV control checks are:
- Placing a file at a well-known path on the web server (not accepted for wildcard names).
- Adding a specific TXT record in DNS (accepted for all certificate types and required for wildcard).
- Answering an email sent to an administrative address of the domain, where the CA allows it.
If you automate issuance with a client that speaks the ACME protocol (RFC 8555), the DNS challenge can be completed by a script that talks to your DNS provider. That is the standard way to keep a wildcard certificate renewed without manual work. Make sure the credentials given to that script are limited to the DNS zone it needs, because anyone holding them can prove control of the domain.
Practical steps for installation and rollout
Whichever structure you choose, the rollout follows the same pattern.
- Generate a private key on the server or in your secrets system, and create a certificate signing request (CSR) that lists the correct names. Never email the private key.
- Complete the domain validation the provider asks for and wait for issuance. Download the certificate and the intermediate chain.
- Install the certificate and the full chain on each server or load balancer. Missing intermediates are a classic cause of errors that appear in API clients but not in desktop browsers.
- Test each hostname from outside your network. Use a browser for the app and a command line client or a small script for the API, since scripts are stricter about chains.
- Set up monitoring that checks the expiry date of every hostname. A simple daily check that alerts at thirty days and again at fourteen days prevents most surprises.
- Document where the certificate and key are stored, who can access them, and how renewal is performed.
If your API is called by mobile apps or by customers' servers, announce renewals that change intermediates or key types. Most clients cope, but a few older libraries have trust stores that are out of date.
Limits and what to watch for
Several details trip up even experienced teams.
- A wildcard covers exactly one label. *.example.com matches app.example.com but not eu.app.example.com and not example.com itself, unless the bare domain is listed as an additional name.
- Shared keys spread risk. If a wildcard key is copied to ten servers, a compromise of any one of them affects all the names. Use a secrets manager, limit access and consider separate certificates for sensitive services.
- Certificate pinning in mobile apps or partner clients can make a renewal painful. If clients pin a public key, keep the same key across renewals or plan a coordinated rollout. Pinning to a certificate is more fragile than pinning to a trusted authority.
- Redirects hide problems. A browser may follow a redirect from example.com to app.example.com and appear fine, while an API client that connects directly to a name without a certificate fails.
- Internal names cannot be covered by public certificates. Hostnames like api.internal or addresses in private ranges are not valid for publicly trusted certificates, so internal services need a private certificate authority.
- Expiry dates are shortening across the industry, and renewal automation is becoming the norm. Plan for automation even if your first certificate lasts a year.
- Do not assume that a certificate protects against attacks on the application itself. It protects the transport only.
What to ask a provider before you buy
When you look at a product page, compare the details rather than the headline name. Useful questions are: does the wildcard certificate include the bare domain, how many names can a multi-name certificate hold, which validation methods are offered, how is reissue handled when you add a name, and what happens if you need to replace a lost key. Also check how long the validity period is and whether renewal is manual or can be automated. The answers are on the product page, and you can compare them on the SSL certificates page without committing to a particular type in advance.
Summary
For app.example.com and api.example.com you can use one certificate per hostname, a wildcard for *.example.com, or a multi-name certificate that lists each name. A wildcard suits growing sets of subdomains, a SAN certificate suits a short fixed list and separate certificates suit teams that must keep keys apart. Remember that a wildcard covers one label only, that the bare domain needs to be included explicitly, that DNS validation is usually required for wildcards, and that shared private keys increase risk. To see how the root domain is handled, read whether a wildcard covers the root domain.
When you are ready to compare options, the SSL page lists the certificate types and what each one includes.
Frequently asked questions
Can one certificate cover both app.example.com and api.example.com?
Yes. A wildcard certificate for *.example.com covers both, and so does a multi-name (SAN) certificate that lists each hostname. A single-name certificate covers only the one hostname it was issued for.
Does a wildcard certificate for *.example.com cover example.com itself?
Not by definition. A wildcard matches exactly one label in front of the domain. Many providers add the bare domain as an extra name in the same certificate, so check the product description before you rely on it.
Should the app and the API use the same private key?
It is possible, but separate certificates and keys limit the damage if one server is compromised. If you share a wildcard certificate, protect the private key carefully and limit who can copy it.
Will an API client break when I change the certificate?
Only if the client pins a specific certificate or key. Clients that validate the normal chain to a trusted authority and check the hostname will accept a renewed certificate without code changes.
How do I decide between wildcard and multi-name?
Count how many hostnames you have now and how many you expect to add. A short, stable list suits a multi-name certificate. A growing or unpredictable set of subdomains suits a wildcard.
References
About the author

Bob Kanokphon Thongdee
- Founder of XPASS VPN
- Co-founder of eSIMonline.asia
- More than 7 years in online marketing
- Founder of Cojourney Visa and Cojourney Travel
Need an SSL certificate?
Pick the certificate type that fits your site and see the price before you check out.
SSL from $14.99
See SSL certificatesKeep reading

SSL Guides
Is a Wildcard SSL Certificate Worth It for a Site with Many Subdomains?
Whether a wildcard pays off depends on how many subdomains you run, how often they change and who manages the certificate. Here is a way to decide.
10 min read

SSL Guides
Does a Wildcard SSL Certificate Cover the Root Domain?
A wildcard matches one label in front of your domain, so the bare domain is a separate case. See how matching works and how to make sure example.com is covered.
9 min read

SSL Guides
What Is a SAN SSL Certificate and When Does It Suit Sites with Several Names?
A SAN certificate lists every hostname it protects. Learn how the list works, how to plan it, and where it fits better than a wildcard.
10 min read