Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
VGSources
Blog

How to Create an ECC (ECDSA) SSL Certificate for Nginx

A complete Nginx guide to creating and deploying an ECC/ECDSA certificate, from OpenSSL key generation and SANs to chain ordering, curve settings, dual RSA/ECDSA support, validation, troubleshooting, and renewal.
Length12 min Posted Quest giverVGSources Team

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To create an ECC certificate for Nginx, generate an ECDSA private key, create a certificate-signing request (CSR) containing every required DNS name, obtain a certificate from a trusted certificate authority (CA), place the leaf certificate before its intermediate certificates in a PEM chain file, and point Nginx to that chain and the matching key. Test the configuration with nginx -t before every reload.

ECC is commonly used as shorthand for an ECDSA certificate and its elliptic-curve private key. The process below covers public ACME issuance, manually submitted CSRs, laboratory self-signed certificates, Nginx curve selection, RSA/ECDSA coexistence, validation, renewal, and the failures that most often prevent a successful deployment.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What an ECC certificate means in Nginx

Elliptic-curve cryptography is a family of algorithms. In an HTTPS server certificate, the relevant form is usually ECDSA: the certificate contains an elliptic-curve public key and is signed according to the CA’s policy. The corresponding private key must also be an EC key. Nginx does not need a special ECC directive; it reads the PEM-encoded certificate chain through ssl_certificate and the matching PEM private key through ssl_certificate_key.

The certificate’s curve is part of the compatibility decision. A client must support the certificate’s signature and key type, and Nginx/OpenSSL must be able to use the curve during the TLS handshake. An ECC certificate is therefore not automatically compatible with every old client or every old Nginx/OpenSSL build.

Prerequisites

  • A hostname you control and a list of every DNS name that must appear in the certificate’s Subject Alternative Name (SAN) extension.
  • Shell access to the Nginx host or to a controlled administration machine that can securely transfer the resulting files.
  • OpenSSL with elliptic-curve key and CSR support. The -addext option used below is available only in versions that support it.
  • An Nginx build with TLS support, permission to read the certificate and key files, and a way to reload the service safely.
  • A renewal plan. A certificate that is installed correctly but allowed to expire is still an outage.

Choose how the certificate will be issued

Decide the trust and operating model before generating files. The key and CSR can be generated locally for any of these models, but the certificate returned by the issuer determines whether browsers and other clients trust it.

Issuance model Trust Automation Appropriate use
Public CA through ACME Trusted by clients that include the public CA roots Designed for automated issuance and renewal Public websites and APIs
Public CA with a manually submitted CSR Publicly trusted after the CA validates the request File delivery and renewal are managed by your team or the CA portal Environments that require approval or an internal change process
Self-signed certificate Trusted only on devices where you install the certificate or a private root Self-managed Internal labs, development, and controlled testing; not a production replacement for a public chain
Managed Nginx certificate service Depends on the service’s documented CA and trust model May provide automatic rotation without configuration changes when ECC/ECDSA is supported Teams that want the provider to handle storage and rotation

ACME and ECDSA details

When using a public ACME CA, select an ECDSA key type in the client or issuance profile rather than accepting an RSA default. Let’s Encrypt policy identifies ECDSA keys with the id-ecPublicKey algorithm identifier. When the signing key is P-256, the certificate signature uses ECDSA with SHA-256. The ACME client still has to install the returned leaf and intermediate files where your Nginx configuration expects them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When a self-signed certificate is acceptable

A self-signed certificate can be useful when every test client is under your control and you can install your own trust anchor. It will produce browser warnings and trust failures elsewhere. Do not use it as a substitute for a publicly trusted chain on an Internet-facing production hostname.

Generate an ECDSA private key and CSR

Run the following as the account that manages private keys. The restrictive umask prevents newly created files from being readable by unrelated users.

  1. Create a private directory

    Choose a directory that is not served as web content, set a restrictive umask, and create a hostname-specific location:

    umask 077
    mkdir -p /etc/nginx/tls/example.com
    cd /etc/nginx/tls/example.com
  2. Generate the EC private key

    The example uses the widely deployed P-256 curve, called prime256v1 by OpenSSL:

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    openssl ecparam -name prime256v1 -genkey -noout -out example.com.key

    The resulting example.com.key is the credential that proves control of the certificate’s public key. Never send it to the CA, place it in a ticket, or copy it into a web-accessible directory.

  3. Create a CSR with SAN entries

    Put every required DNS name in the SAN extension. The common name alone is not a substitute for SANs:

    openssl req -new -sha256 -key example.com.key -out example.com.csr 
      -subj '/CN=example.com' 
      -addext 'subjectAltName=DNS:example.com,DNS:www.example.com'

    Replace the names with the hostnames that will actually be served. If the installed OpenSSL does not recognize -addext, place the SAN extension in an OpenSSL configuration file and pass that file with -config when creating the CSR. Do not assume that adding a name to Nginx’s server_name later will add it to an already issued certificate.

  4. Submit only the CSR

    Send example.com.csr to the public CA, ACME client, or internal CA according to its enrollment procedure. Keep the private key on the server or controlled administration host. After validation, obtain the leaf certificate and the CA’s intermediate certificate bundle in PEM format.

    What’s actually slowing this PC down?

    Pick the symptom - the matching free tool is one click away.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Build the certificate chain in the required order

Nginx expects the file named by ssl_certificate to contain the server’s leaf certificate first, followed by the intermediate certificate or certificates. The order matters: a chain assembled incorrectly can make Nginx refuse to start or can leave clients unable to build a trusted path.

After receiving the files, concatenate them without changing their PEM boundaries:

cat cert.pem intermediate.pem > fullchain.pem
chmod 600 example.com.key
chmod 644 fullchain.pem

If the CA supplied more than one intermediate, append each one after the leaf in the order specified by that CA. The private key should be readable only by the account that needs it, while the chain can normally be world-readable if the directory permissions allow Nginx to traverse the path. Keep backups of the old key and chain outside the document root so a failed renewal can be diagnosed or restored.

Configure the Nginx HTTPS server

Add the certificate and key to the TLS-enabled server block for the hostname:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
server {
    listen 443 ssl;
    server_name example.com www.example.com;

    ssl_certificate     /etc/nginx/tls/example.com/fullchain.pem;
    ssl_certificate_key /etc/nginx/tls/example.com/example.com.key;

    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ecdh_curve auto;

    root /var/www/example.com;
    index index.html;
}

What each TLS directive does

  • listen 443 ssl; enables TLS on the standard HTTPS port for this server block.
  • server_name selects the virtual host, but it does not change the certificate’s SAN list.
  • ssl_certificate must point to the PEM chain with the leaf first and intermediates after it.
  • ssl_certificate_key must point to the private key that generated the public key in the leaf certificate.
  • ssl_protocols TLSv1.2 TLSv1.3; limits negotiation to these protocols where the installed Nginx and OpenSSL versions support them.
  • ssl_ecdh_curve controls the elliptic-curve groups offered for key exchange. It is separate from the certificate file, but the certificate’s curve must be available to the TLS stack.

Choose a curve policy

ssl_ecdh_curve auto; lets Nginx and OpenSSL choose from their supported groups. This is a practical default when the server and client population are not governed by a narrow compatibility policy.

If you need an explicit policy, Nginx documents a list such as prime256v1:secp384r1. Include the curve used by the ECDSA certificate and verify that the installed build supports every named group. Excluding the certificate’s curve can prevent ECDSA from working even though the certificate and key files are otherwise correct.

Serve RSA and ECDSA certificates together

ECDSA-only deployment reduces the choices available to clients that do not support ECDSA. Nginx can offer both certificate families when the version supports repeated certificate directives:

ssl_certificate     /etc/nginx/tls/example.com/fullchain-ecdsa.pem;
ssl_certificate_key /etc/nginx/tls/example.com/ecdsa.key;
ssl_certificate     /etc/nginx/tls/example.com/fullchain-rsa.pem;
ssl_certificate_key /etc/nginx/tls/example.com/rsa.key;

Nginx has supported repeating these directives for different certificate types, such as RSA and ECDSA, since version 1.11.0. Separate certificate chains for the two certificates require OpenSSL 1.0.2 or newer. Each certificate must have its own matching key and complete chain. Clients and the TLS stack can then select the family they support instead of forcing every connection to use ECDSA.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Validate the files before reloading Nginx

Validation should be a stop condition, not a formality. Inspect the certificate, confirm the key relationship, and test the complete Nginx configuration before replacing the running process.

  1. Inspect the certificate metadata

    openssl x509 -in fullchain.pem -noout -subject -issuer -dates -text

    Check that the first certificate is the intended leaf, the SAN extension contains every production hostname, the issuer is the CA you selected, and the validity dates cover the planned service period.

  2. Check the private-key relationship

    openssl pkey -in example.com.key -pubout -outform pem | sha256sum

    For a mismatch investigation, extract the public key from the leaf certificate and compare its hash with the command above:

    openssl x509 -in cert.pem -pubkey -noout | sha256sum

    The public-key outputs must match. A key from another hostname, an old renewal, or a file overwritten by an automation job will produce a mismatch even when both files are valid PEM.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  3. Test the Nginx configuration

    nginx -t

    Run the test with the privileges required to read the configured files. Treat any error as a reason not to reload. Fix the reported path, permission, PEM-format, chain-order, curve, or key-mismatch problem first.

Reload safely and keep a rollback path

Only reload after nginx -t reports a successful configuration test:

systemctl reload nginx

A reload asks the running master process to open the new files while existing connections finish. Keep the previous certificate and key in a protected backup location until the live endpoint has been checked. If the new files fail validation, do not force a reload; restore the known-good files, run nginx -t again, and reload only after the test passes.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Verify the certificate that clients actually receive

Local file inspection cannot prove that the intended virtual host is serving the intended chain. Query the public hostname with SNI:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
openssl s_client -connect example.com:443 -servername example.com -showcerts </dev/null

Review the certificate subject, SANs, issuer, validity dates, and the certificates sent after the leaf. Confirm that the negotiated protocol is one you intended to permit and that the intermediate certificate is delivered to clients. A browser check from a separate network is useful for catching DNS, load-balancer, or virtual-host routing mistakes that a local file test cannot see.

If the command shows a certificate for another hostname, check that the request includes the correct -servername value and that the matching Nginx server_name block is enabled. If the chain is incomplete, rebuild the chain file from the CA’s leaf and intermediate files and repeat the configuration test before reloading.

Plan renewal before the certificate expires

Public certificates are time-limited, so installation is only half of the operation. An ACME client can generate or reuse an ECDSA key, obtain a replacement certificate, and write a new chain. A manual CA workflow requires a scheduled reminder and a documented replacement procedure.

Recommended renewal sequence

  1. Run the ACME or CA renewal process far enough ahead of expiry to allow for validation failures and DNS or firewall corrections.
  2. Write the renewed leaf and intermediate certificates to temporary files, then assemble the production fullchain.pem with the leaf first.
  3. Preserve restrictive ownership and permissions on the private key and ensure the Nginx master process can read both configured paths.
  4. Run nginx -t against the complete configuration.
  5. Reload only after the test succeeds, preferably from a deploy hook that stops on a failed test.
  6. Query the live endpoint and confirm that the new dates, SANs, issuer, and chain are being served.

Use an atomic file replacement strategy where possible: write and validate the new files first, then move them into the configured paths. This prevents Nginx from reading a partially written PEM file during a renewal job. Automatic rotation is a feature of some managed Nginx certificate services, but verify that the service explicitly supports ECC/ECDSA and documents whether a reload is required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshoot common ECC certificate failures

Symptom Likely cause Resolution
nginx -t reports that it cannot load the certificate Wrong path, unreadable file, malformed PEM, or a chain file assembled incorrectly Check the exact paths, ownership, directory traversal permissions, and PEM delimiters. Rebuild the chain from the leaf followed by the CA intermediates, then test again.
Private key does not match the certificate The key belongs to a different CSR or a renewal job paired old and new files Compare public-key hashes from the key and leaf certificate. Install the matching pair generated from the same CSR.
Clients report an untrusted or incomplete chain The intermediate certificate was omitted, placed before the leaf, or not sent by the active server block Use the CA-provided intermediate bundle after the leaf in fullchain.pem, reload after nginx -t, and inspect the live endpoint with SNI.
ECDSA handshake fails while the files look valid The certificate’s curve is not included in the configured ssl_ecdh_curve, or the Nginx/OpenSSL build lacks support Use auto or add the certificate’s supported curve, such as prime256v1 or secp384r1, to an explicit list. Confirm the installed versions and rebuild or upgrade if the group is unavailable.
Browser shows the wrong hostname certificate DNS reaches another server, SNI is missing, or a different Nginx server block wins selection Test with -servername, verify DNS and the enabled configuration, and ensure the requested name appears in the certificate SANs.
Reload fails after a renewal The renewed file is truncated, permissions changed, or the automation wrote to a path different from the configuration Inspect the files, restore the last known-good pair if necessary, run nginx -t, and correct the renewal hook before trying again.
Older clients cannot connect to an ECC-only site The client does not support the ECDSA certificate or the negotiated curve and signature algorithms Serve RSA and ECDSA certificate pairs together on a compatible Nginx/OpenSSL stack, or document the minimum client capability for an ECC-only deployment.

Decide between ECC-only and dual-certificate deployment

Decision factor ECDSA only RSA plus ECDSA
Client compatibility Requires clients and intermediaries that support ECDSA and the selected curve Offers a fallback certificate family for clients that do not
Configuration One certificate/key pair and one chain to renew Two certificate/key pairs and two chains to track
Nginx requirement Any build that supports the chosen ECDSA key and curve Repeated certificate directives from Nginx 1.11.0; separate chains require OpenSSL 1.0.2 or newer
Operations Simpler file management More renewal and monitoring work, but a broader compatibility envelope
Curve policy The ECDSA certificate’s curve must be available through ssl_ecdh_curve ECDSA still needs its curve; RSA connections follow their own signature and key-exchange capabilities

Choose ECC-only when your measured client population and infrastructure support it and the simpler certificate set is valuable. Choose both families when compatibility with unknown or legacy clients matters more than minimizing renewal files. In either case, test the live endpoint rather than assuming that a syntactically valid configuration proves interoperability.

Operational acceptance checklist

  • The private key is stored outside web content with restrictive ownership and permissions.
  • The CSR SAN list exactly covers the hostnames clients use.
  • The CA-issued leaf and all required intermediates are in one PEM chain, with the leaf first.
  • The configured certificate and key form a matching pair.
  • The certificate curve is supported by the Nginx/OpenSSL build and included by the curve policy.
  • nginx -t succeeds before every reload.
  • An SNI-aware live check confirms the expected certificate, protocol, dates, and intermediate chain.
  • Renewal writes complete files, validates them, reloads only on success, and alerts before expiry.

Following this sequence gives Nginx the three things an ECC deployment depends on: a valid ECDSA key and certificate pair, a correctly ordered trust chain, and a TLS configuration whose curve and client-compatibility policy match the certificate you issued.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.