Skip to content

ERR_SSL_SERVER_CERT_BAD_FORMAT

Key idea:

ERR_SSL_SERVER_CERT_BAD_FORMAT — browser could not parse the server certificate. ASN.1/DER encoding error, truncated cert, base64 issue, or non-standard extensions. Fix: openssl x509 -in cert.pem -text — if it parses, cert is OK → problem is in server send path. Otherwise regenerate cert.

Below: causes, fixes, FAQ.

Check your site's SSL →

Common Causes

  • Cert file corrupted (truncated on copy)
  • Non-DER encoding (PEM vs DER mismatch)
  • Custom ASN.1 extension with invalid syntax
  • nginx ssl_certificate points to chain without leaf cert
  • Invalid cert from custom CA

Step-by-Step Fix

  1. Parse cert: openssl x509 -in cert.pem -text -noout
  2. Re-download cert from CA (Let's Encrypt certbot renew --force-renewal)
  3. Verify nginx config: ssl_certificate fullchain.pem; (not cert.pem alone)
  4. Compare sizes: leaf cert typical 1500-2500 bytes
  5. Enterno SSL Checker — automated diagnosis

Check SSL Certificate →

Related SSL Errors

TL;DR: Resolving ERR_SSL_SERVER_CERT_BAD_FORMAT

The ERR_SSL_SERVER_CERT_BAD_FORMAT error indicates that the SSL certificate presented by the server is malformed or improperly configured. To resolve this issue, ensure that the certificate adheres to the X.509 standard, is correctly encoded in PEM format, and includes the appropriate chain of trust. Use tools like OpenSSL to verify the certificate’s format with the command openssl x509 -in your_cert.pem -text -noout.

Understanding the ERR_SSL_SERVER_CERT_BAD_FORMAT Error

The ERR_SSL_SERVER_CERT_BAD_FORMAT error often arises when a web browser encounters an SSL certificate that does not meet the expected format or standards. This can occur due to various reasons, including:

  • Incorrect Encoding: SSL certificates must be encoded in PEM format, which uses Base64 encoding and includes specific header and footer lines.
  • Incomplete Certificate Chain: The absence of intermediate certificates can lead to trust issues. Browsers need the full chain to validate the server’s identity.
  • Expired or Revoked Certificates: Using certificates that have passed their validity period or have been revoked can also trigger this error.

To ensure that your SSL certificate is compliant, it is important to follow industry standards such as those set by the Internet Engineering Task Force (IETF) and the CA/Browser Forum. Here are some steps to diagnose and fix the issue:

  1. Verify Certificate Format: Check the certificate encoding. Use the command openssl x509 -in your_cert.pem -text -noout to display the certificate details. Look for proper headers like -----BEGIN CERTIFICATE----- and -----END CERTIFICATE-----.
  2. Check the Certificate Chain: Use openssl s_client -connect yourdomain.com:443 -showcerts to retrieve the full certificate chain. Ensure that all intermediate certificates are included.
  3. Review Expiration Dates: Confirm that the certificate is still valid by checking the Not Before and Not After dates in the output of the previous command.

Practical Steps to Fix ERR_SSL_SERVER_CERT_BAD_FORMAT

To effectively resolve the ERR_SSL_SERVER_CERT_BAD_FORMAT error, follow these practical steps:

Step 1: Inspect Your SSL Certificate

Begin by inspecting your SSL certificate using OpenSSL. You can run the following command to check the certificate:

openssl x509 -in your_cert.pem -text -noout

This command will output the details of the certificate, including its validity period, issuer, and subject. Ensure that the format is correct and there are no extraneous characters.

Step 2: Validate the Certificate Chain

Next, check if the complete certificate chain is presented. Use the command:

openssl s_client -connect yourdomain.com:443 -showcerts

This will display all certificates sent by the server. Verify that all necessary intermediate certificates are included. If not, you may need to obtain the missing certificates from your Certificate Authority (CA).

Step 3: Reconfigure Your Web Server

If your certificate is malformed or improperly configured, you may need to reconfigure your web server. For example, in Apache, you can specify the certificate file and the chain file in your configuration:

SSLCertificateFile /path/to/your_cert.pem
SSLCertificateChainFile /path/to/chain.pem

After making changes, restart your web server to apply the new configuration:

sudo systemctl restart apache2

Step 4: Test the Configuration

Finally, use an SSL testing tool such as SSL Labs’ SSL Test to analyze your server's SSL configuration. This will help identify any remaining issues that need to be addressed.

By following these steps, you can effectively troubleshoot and resolve the ERR_SSL_SERVER_CERT_BAD_FORMAT error, ensuring a secure connection for your users.

CertificateExpiry, issuer, domains (SAN)
ChainIntermediate and root CA validation
TLS ProtocolTLS version and cipher suite
VulnerabilitiesHeartbleed, POODLE, weak ciphers

Why teams trust us

TLS 1.3
supported
Full
CA chain check
<2s
result
30/14/7
days-to-expiry alerts

How it works

1

Enter domain

2

TLS chain verified

3

Expiry date & vulnerabilities

What Does the SSL Check Cover?

SSL/TLS is the encryption protocol that protects data between the browser and server. Our tool analyzes the certificate, chain of trust, TLS version, and knownvulnerabilities.

Certificate Details

Issuer, validity period, signature algorithm, covered domains (SAN), and validation type (DV/OV/EV).

Chain of Trust

Full chain verification: from leaf certificate through intermediates to root CA.

TLS Analysis

Protocol version (TLS 1.2/1.3), cipher suites, Perfect Forward Secrecy (PFS) support.

Expiry Alerts

Set up a monitor — get Telegram and email alerts 30/14/7 days before expiration.

DV vs OV vs EV Certificates

DV (Domain Validation)
  • Confirms domain ownership only
  • Issued in minutes automatically
  • Free via Let's Encrypt
  • Suitable for most websites
  • Most common certificate type
OV / EV
  • Organization (OV) or Extended Validation (EV)
  • Issued in 1-5 business days
  • Costs $50 to $500/year
  • For finance, e-commerce, government sites
  • Increases user trust

Who uses this

DevOps

SSL certificate monitoring

Security

TLS config audit

SEO

HTTPS as ranking factor

E-commerce

customer trust

Common Mistakes

Expired certificateBrowsers block sites with expired SSL. Set up auto-renewal or monitoring.
Incomplete certificate chainWithout intermediate CA, some browsers and bots cannot verify the certificate.
Mixed content on HTTPS siteHTTP resources on an HTTPS page — the browser lock icon disappears, reducing trust.
Using TLS 1.0/1.1Legacy TLS versions have known vulnerabilities. Use TLS 1.2+ or 1.3.
Domain mismatch in certificateThe certificate must cover all site domains, including www and subdomains.

Best Practices

Set up auto-renewalLet's Encrypt + certbot with cron — certificate renews automatically every 60-90 days.
Enable HSTSStrict-Transport-Security header forces browsers to always use HTTPS.
Use TLS 1.3TLS 1.3 is faster (1-RTT handshake) and safer — legacy ciphers removed.
Monitor expiration datesCreate a monitor on Enterno.io — get notified well before expiration.
Verify chain after renewalAfter certificate renewal, confirm that intermediate certificates are installed.

Get more with a free account

SSL certificate monitoring, check history and alerts 30 days before expiry.

Sign up free

Learn more

Sources

Frequently Asked Questions

PEM vs DER?

PEM: text-based base64 (-----BEGIN CERTIFICATE-----). DER: binary ASN.1. nginx reads PEM, Java stacks — DER.

fullchain.pem format?

Sequential PEM-encoded certs (leaf, intermediate, optional root). Files separated by -----END-BEGIN-----.

Custom extensions?

EV certs have qcStatements (eIDAS), Microsoft CA — specific OIDs. Some libraries (old OpenSSL) cannot parse these.

Monitor cert validity?

<a href="/en/ssl">Enterno SSL</a> daily monitor + email/Telegram alert 14d before expiry.

Try the live tool that powered this guide

Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.