Home/Blog/Wildcard vs SAN Certificates: Which SSL Certificate Type Do You Need?
Security

Wildcard vs SAN Certificates: Which SSL Certificate Type Do You Need?

Compare wildcard and SAN (Subject Alternative Name) certificates to choose the right SSL/TLS certificate for your infrastructure. Understand security trade-offs, cost considerations, and use cases for each type.

By Inventive HQ Team
Wildcard vs SAN Certificates: Which SSL Certificate Type Do You Need?

Choosing between wildcard and SAN (Subject Alternative Name) certificates is one of the most common decisions in SSL/TLS certificate management. This guide compares both certificate types, explains their security implications, and helps you choose the right approach for your infrastructure.

Quick Comparison

┌─────────────────────────────────────────────────────────────────────────────┐
│               Wildcard vs SAN Certificate Comparison                         │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│  WILDCARD CERTIFICATE                 SAN CERTIFICATE                        │
│  *.example.com                        example.com                            │
│  ─────────────────────                example.org                            │
│                                       www.example.com                        │
│  ✓ www.example.com                    api.example.com                        │
│  ✓ api.example.com                    shop.other-brand.com                   │
│  ✓ mail.example.com                   ─────────────────────                  │
│  ✓ anything.example.com                                                      │
│  ✓ future-subdomain.example.com       ✓ Only listed domains                  │
│                                       ✗ No unlisted domains                  │
│  ✗ example.com (bare domain)          ✗ No pattern matching                  │
│  ✗ sub.sub.example.com                                                       │
│                                                                              │
│  SECURITY                             SECURITY                               │
│  ─────────                            ─────────                              │
│  Higher risk if compromised           Lower risk if compromised              │
│  (any subdomain vulnerable)           (only listed domains vulnerable)       │
│                                                                              │
│  FLEXIBILITY                          FLEXIBILITY                            │
│  ────────────                         ────────────                           │
│  No certificate updates for           Must update certificate for            │
│  new subdomains                       new domains                            │
│                                                                              │
│  COST (Commercial)                    COST (Commercial)                      │
│  ──────────────────                   ──────────────────                     │
│  $75-200/year (unlimited)             $10-30 per domain                      │
│  Best for 5+ subdomains               Best for mixed domains                 │
│                                                                              │
│  Let's Encrypt: FREE                  Let's Encrypt: FREE                    │
│  (DNS-01 challenge required)          (HTTP-01 or DNS-01)                    │
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

Understanding Wildcard Certificates

A wildcard certificate uses an asterisk (*) to match any single label in a domain name.

What Wildcards Cover

Certificate: *.example.com

┌─────────────────────────────────────────────────────────────────────────────┐
│                        Wildcard Coverage                                     │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│  ✓ COVERED                           ✗ NOT COVERED                          │
│  ─────────                           ─────────────                          │
│                                                                              │
│  www.example.com                     example.com (bare domain)              │
│  api.example.com                     dev.api.example.com (2 levels)         │
│  mail.example.com                    sub.sub.example.com (2 levels)         │
│  cdn.example.com                     other-domain.com                       │
│  dev.example.com                     example.org                            │
│  staging.example.com                                                        │
│  anything-new.example.com                                                   │
│  123.example.com                                                            │
│  a.example.com                                                              │
│                                                                              │
│  Pattern: *.example.com matches [anything].example.com                      │
│           where [anything] is a single label (no dots)                      │
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

Including the Bare Domain

Wildcard certificates don't cover the bare domain (example.com). Always request both:

# Certbot with Let's Encrypt
certbot certonly --dns-cloudflare \
  -d "*.example.com" \
  -d "example.com"

# CSR with OpenSSL (subjectAltName)
[alt_names]
DNS.1 = *.example.com
DNS.2 = example.com

Wildcard Use Cases

Good for Wildcards:

  • Dynamic subdomains (user1.app.com, user2.app.com)
  • Microservices with many endpoints (api., auth., db.*)
  • Development/staging environments (dev., staging., test.*)
  • Content delivery (cdn1., cdn2., static.*)
  • Multi-tenant SaaS platforms

Avoid Wildcards When:

  • You have only 2-3 subdomains (SAN is simpler)
  • Security is critical (limits blast radius)
  • Domains span different base domains
  • You need fine-grained certificate control

Understanding SAN Certificates

SAN (Subject Alternative Name) certificates list each covered domain explicitly.

What SANs Cover

Certificate SANs:
- example.com
- www.example.com
- example.org
- api.example.com
- shop.other-brand.com

┌─────────────────────────────────────────────────────────────────────────────┐
│                          SAN Coverage                                        │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│  ✓ COVERED (explicitly listed)       ✗ NOT COVERED                          │
│  ──────────────────────────────      ─────────────                          │
│                                                                              │
│  example.com                         mail.example.com (not listed)          │
│  www.example.com                     staging.example.com (not listed)       │
│  example.org                         anything-else.example.com              │
│  api.example.com                                                            │
│  shop.other-brand.com                                                       │
│                                                                              │
│  Only explicitly listed domains are covered.                                │
│  Adding new domains requires new certificate.                               │
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

SAN Certificate Limits

Certificate AuthorityMax SANsNotes
Let's Encrypt100Free
DigiCert250Enterprise pricing
Sectigo250Volume discounts
GlobalSign100Standard; more on request
GoDaddy100Per-SAN pricing

SAN Use Cases

Good for SANs:

  • Multiple distinct brands (brand1.com, brand2.com, brand3.com)
  • Known, fixed set of domains
  • High-security environments (explicit allow-list)
  • Mixed apex domains and subdomains
  • Consolidating certificates across acquisitions

Avoid SANs When:

  • You frequently add new subdomains
  • You have dynamic/user-generated subdomains
  • You have 10+ subdomains of one base domain

Security Comparison

Blast Radius Analysis

┌─────────────────────────────────────────────────────────────────────────────┐
│                    Security: Blast Radius Comparison                         │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│  SCENARIO: Private key is compromised                                        │
│                                                                              │
│  WILDCARD (*.example.com)            SAN (listed domains only)              │
│  ─────────────────────────           ──────────────────────────             │
│                                                                              │
│  Attacker can impersonate:           Attacker can impersonate:              │
│                                                                              │
│  ✗ www.example.com                   ✗ www.example.com                      │
│  ✗ api.example.com                   ✗ api.example.com                      │
│  ✗ mail.example.com                  ✗ example.com                          │
│  ✗ admin.example.com                                                        │
│  ✗ secure.example.com                ✓ admin.example.com (NOT listed)       │
│  ✗ bank.example.com                  ✓ bank.example.com (NOT listed)        │
│  ✗ ANY-SUBDOMAIN.example.com         ✓ future domains (NOT listed)          │
│  ✗ future-domains.example.com                                               │
│  ✗ phishing.example.com                                                     │
│                                                                              │
│  IMPACT: SEVERE                      IMPACT: LIMITED                         │
│  All subdomains compromised          Only 3 listed domains compromised      │
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

Recommendation by Security Level

Security LevelRecommendation
High Security (Banking, Healthcare)SAN certificates with minimum domains, or individual certs per service
Standard Security (Business apps)SAN for production, Wildcard for dev/staging
Convenience-focused (Internal tools)Wildcard for simplicity

Combining Wildcards and SANs

You can include both wildcards and specific SANs in one certificate:

Certificate SANs:
- *.example.com        (wildcard)
- example.com          (bare domain)
- *.staging.example.com (second-level wildcard)
- partner-brand.com    (different domain)

Multi-Domain Wildcard Example

# Request multi-domain wildcard from Let's Encrypt
certbot certonly --dns-cloudflare \
  -d "*.example.com" \
  -d "example.com" \
  -d "*.example.org" \
  -d "example.org" \
  -d "*.other-brand.com" \
  -d "other-brand.com"

This creates one certificate covering:

  • All subdomains of example.com
  • All subdomains of example.org
  • All subdomains of other-brand.com
  • The bare domains of all three

Cost Analysis

Let's Encrypt (Free)

Both wildcard and SAN certificates are free. Cost is only operational:

TypeCostRequirement
Single DomainFreeHTTP-01 or DNS-01
SAN (up to 100)FreeHTTP-01 or DNS-01
WildcardFreeDNS-01 only
Multi-WildcardFreeDNS-01 only

Commercial Certificates (Approximate)

ScenarioWildcard CostSAN CostRecommendation
3 subdomains$150/year$90/year (3×$30)SAN
5 subdomains$150/year$150/year (5×$30)Either
10 subdomains$150/year$300/yearWildcard
20 subdomains$150/year$600/yearWildcard
3 different domainsN/A$90/yearSAN

Decision Framework

┌─────────────────────────────────────────────────────────────────────────────┐
│                    Certificate Type Decision Tree                            │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│  START: How many domains/subdomains?                                         │
│                        │                                                     │
│            ┌──────────┴──────────┐                                          │
│            ▼                      ▼                                          │
│       1-3 domains           4+ subdomains                                   │
│            │                      │                                          │
│            ▼                      ▼                                          │
│    ┌───────────────┐      Same base domain?                                 │
│    │ SAN Certificate│             │                                          │
│    │ (simpler)     │     ┌───────┴───────┐                                  │
│    └───────────────┘     ▼               ▼                                  │
│                         YES             NO                                   │
│                          │               │                                   │
│                          ▼               ▼                                   │
│               Dynamic subdomains?   ┌───────────────┐                       │
│                    │                │ SAN Certificate│                       │
│            ┌───────┴───────┐       │ (multi-domain) │                       │
│            ▼               ▼       └───────────────┘                        │
│           YES             NO                                                 │
│            │               │                                                 │
│            ▼               ▼                                                 │
│  ┌─────────────────┐  High security?                                        │
│  │ WILDCARD        │       │                                                 │
│  │ *.example.com   │   ┌───┴───┐                                            │
│  └─────────────────┘   ▼       ▼                                            │
│                       YES     NO                                             │
│                        │       │                                             │
│                        ▼       ▼                                             │
│              ┌──────────────┐  ┌─────────────────┐                          │
│              │ SAN (explicit│  │ WILDCARD        │                          │
│              │ domains only)│  │ (convenience)   │                          │
│              └──────────────┘  └─────────────────┘                          │
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

Implementation Examples

Wildcard with Let's Encrypt

# Install Certbot with Cloudflare DNS plugin
sudo apt install certbot python3-certbot-dns-cloudflare

# Create credentials file
cat > ~/.secrets/cloudflare.ini << 'EOF'
dns_cloudflare_api_token = YOUR_API_TOKEN
EOF
chmod 600 ~/.secrets/cloudflare.ini

# Request wildcard certificate
sudo certbot certonly \
  --dns-cloudflare \
  --dns-cloudflare-credentials ~/.secrets/cloudflare.ini \
  -d "*.example.com" \
  -d "example.com"

# Certificate location
# /etc/letsencrypt/live/example.com/fullchain.pem
# /etc/letsencrypt/live/example.com/privkey.pem

SAN with Let's Encrypt

# SAN certificate with HTTP-01 (no DNS plugin needed)
sudo certbot certonly \
  --nginx \
  -d "example.com" \
  -d "www.example.com" \
  -d "api.example.com" \
  -d "shop.example.com"

# Or with standalone mode
sudo certbot certonly \
  --standalone \
  -d "example.com" \
  -d "www.example.com" \
  -d "api.example.com"

Kubernetes cert-manager

# Wildcard certificate
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: wildcard-example-com
spec:
  secretName: wildcard-example-com-tls
  issuerRef:
    name: letsencrypt-prod
    kind: ClusterIssuer
  dnsNames:
    - "*.example.com"
    - "example.com"

---
# SAN certificate
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: multi-domain
spec:
  secretName: multi-domain-tls
  issuerRef:
    name: letsencrypt-prod
    kind: ClusterIssuer
  dnsNames:
    - "example.com"
    - "www.example.com"
    - "api.example.com"
    - "example.org"

Conclusion

Choose Wildcard When:

  • You have many subdomains of one base domain
  • Subdomains are created dynamically
  • Convenience outweighs security concerns
  • You're managing development/staging environments

Choose SAN When:

  • You need multiple different base domains
  • Security is paramount (explicit allow-list)
  • You have a small, fixed set of domains
  • You want fine-grained control

Best Practices:

  1. Always include bare domain with wildcards (example.com + *.example.com)
  2. Use SAN for production, wildcard for non-production when security matters
  3. Monitor Certificate Transparency logs for unauthorized certificates
  4. Automate renewal regardless of certificate type
  5. Consider mTLS with individual certificates for service-to-service authentication

For complete certificate management guidance, see our TLS Certificate Complete Guide.

Frequently Asked Questions

Find answers to common questions

A wildcard certificate (*.example.com) covers unlimited first-level subdomains of a single base domain. A SAN (Subject Alternative Name) certificate lists specific domain names (up to 100-250) that can be from different base domains. Wildcard is simpler for many subdomains of one domain; SAN is more flexible for specific domains across different base domains. Wildcard has broader blast radius if compromised; SAN limits exposure to listed domains.

No, standard wildcard certificates only cover one level. .example.com covers www.example.com, api.example.com, and mail.example.com, but NOT dev.api.example.com or ..example.com. For multi-level subdomains, you need either a SAN certificate listing each subdomain, multiple wildcard certificates (.api.example.com), or a wildcard combined with SANs. Some CAs offer multi-level wildcards as special products.

SAN certificates are generally more secure because they explicitly list allowed domains, limiting exposure if the private key is compromised. A compromised wildcard certificate allows attackers to impersonate ANY subdomain, including ones that don't exist yet. With SAN, attackers can only impersonate the specific domains listed. For high-security environments, prefer SAN certificates with the minimum necessary domains.

Yes, you can deploy the same wildcard certificate on multiple servers. This is common for load-balanced environments or microservices where api.example.com, auth.example.com, and cdn.example.com run on different servers. However, this means the private key exists in multiple locations—increasing risk. Consider using separate certificates per server for high-security environments, or use a centralized secret manager.

Let's Encrypt issues wildcard certificates using DNS-01 challenge only (not HTTP-01). Use Certbot with a DNS plugin: certbot certonly --dns-cloudflare -d "*.example.com" -d "example.com". You must include both *.example.com and example.com since wildcard doesn't cover the bare domain. DNS-01 requires API access to your DNS provider or manual TXT record creation. See our Let's Encrypt Complete Guide for detailed instructions.

Most Certificate Authorities allow 100-250 SANs per certificate, though limits vary. Let's Encrypt allows up to 100 SANs. Enterprise CAs like DigiCert and Sectigo support 250+ SANs. Each SAN can be a different domain (example.com, example.org, other-brand.com) or subdomain. More SANs increase certificate size slightly but have negligible performance impact. Check your CA's specific limits before planning.

For microservices, consider your security requirements. Wildcard (*.internal.example.com) is simpler—deploy once, works for any new service. However, if one service is compromised, attackers can impersonate all services. SAN certificates listing each service (auth.internal, api.internal, db.internal) limit blast radius but require certificate updates when adding services. For production, many teams use mTLS with individual certificates per service via cert-manager.

A multi-domain wildcard certificate combines SAN and wildcard features, covering wildcards for multiple base domains. For example: *.example.com, *.example.org, and *.brand.com in one certificate. This is useful for organizations with multiple brands. Not all CAs offer this; pricing is typically higher than single wildcard. Let's Encrypt supports this—just list multiple wildcards as SANs in your certificate request.

Both certificate types are logged to Certificate Transparency (CT) logs. Wildcard certificates reveal that you own *.example.com but not which specific subdomains exist. SAN certificates expose every listed domain publicly. If you want to hide internal subdomain names, wildcard provides more privacy. However, CT monitoring for unauthorized certificates works the same for both—you can detect if someone else obtains a certificate for your domains.

Let's Encrypt provides both wildcard and SAN certificates free. For commercial CAs: Single domain DV costs $10-50/year. Wildcard DV costs $75-200/year (covers unlimited subdomains). SAN certificates are priced per domain ($10-30/SAN) or as packages (5 SANs for $150/year). For 10+ subdomains of the same base domain, wildcard is usually cheaper. For domains across different bases, SAN may be more economical. Always compare total cost of ownership including renewal.

Don't wait for a breach to act

Get a free security assessment. Our experts will identify your vulnerabilities and create a protection plan tailored to your business.