A Cloudflare Origin CA certificate is the free certificate for the edge-to-origin hop: valid for up to 15 years, trusted by Cloudflare’s Full (Strict) mode — and by nothing else. Installation is four moves: create it in the dashboard, save the private key while it is on screen, place both files on the server, and point the 443 vhost at them. This article is the install and troubleshooting pass for Nginx and Apache; for where the certificate fits in the overall TLS chain, read origin certificates end to end.
What’s happening
Browsers never see this certificate. On a proxied hostname, the visitor negotiates with Cloudflare’s edge certificate; the Origin CA certificate only authenticates the second hop, from Cloudflare’s proxy to your server. It is signed by Cloudflare’s own private CA, which no operating system or browser trust store includes — so hitting the origin directly, or flipping the DNS record to grey-cloud, produces trust warnings. That is expected behaviour, not a broken install. The certificate works with the Full and Full (Strict) modes and is available on every plan, Free included.
What to check first
- The DNS records involved are proxied (orange cloud). Origin CA certificates are only useful behind the proxy.
- Which server actually terminates TLS on 443 — Nginx, Apache, or Nginx sitting in front of Apache (then Nginx gets the certificate).
- Whether a control panel owns the vhost. On cPanel or Plesk, install through the panel’s certificate UI instead of hand-editing configs it will overwrite — the flow is in manual SSL install in cPanel.
- Which hostnames the vhost serves, so the certificate’s SAN list matches all of them.
How to verify
# After installing: what does the origin serve, and does it cover the hostname?
openssl s_client -connect <origin-ip>:443 -servername example.com </dev/null 2>&1 \
| openssl x509 -noout -subject -issuer -dates -ext subjectAltName
# The issuer line should name: CloudFlare Origin SSL Certificate Authority
# Do the certificate and key actually match?
openssl x509 -noout -modulus -in /etc/ssl/cloudflare/example.com.pem | openssl md5
openssl rsa -noout -modulus -in /etc/ssl/cloudflare/example.com.key | openssl md5
# Through the edge, once the zone is on Full (Strict)
curl -sI https://example.com/ | head -3
The fix
-
Create the certificate. In the dashboard: SSL/TLS → Origin Server → Create Certificate. The defaults are right for most sites: let Cloudflare generate the key, keep the hostname list
example.com, *.example.com, and take the 15-year validity. Copy both text blocks now — the certificate and the private key. The key is displayed once and cannot be retrieved later; lose it and you regenerate from scratch. -
Place the files on the server.
sudo mkdir -p /etc/ssl/cloudflare
sudo tee /etc/ssl/cloudflare/example.com.pem >/dev/null # paste the CERTIFICATE block, then Ctrl-D
sudo tee /etc/ssl/cloudflare/example.com.key >/dev/null # paste the PRIVATE KEY block, then Ctrl-D
sudo chmod 600 /etc/ssl/cloudflare/example.com.key
- Nginx. Add the certificate pair to the server block that owns the hostname:
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name example.com www.example.com;
ssl_certificate /etc/ssl/cloudflare/example.com.pem;
ssl_certificate_key /etc/ssl/cloudflare/example.com.key;
}
sudo nginx -t && sudo systemctl reload nginx
- Apache. Enable the SSL module if needed (
a2enmod sslon Debian/Ubuntu; on RHEL-family the package ismod_ssland the service ishttpd):
<VirtualHost *:443>
ServerName example.com
ServerAlias www.example.com
SSLEngine on
SSLCertificateFile /etc/ssl/cloudflare/example.com.pem
SSLCertificateKeyFile /etc/ssl/cloudflare/example.com.key
</VirtualHost>
sudo apachectl configtest && sudo systemctl reload apache2
- Switch the zone to Full (Strict) under SSL/TLS → Overview, then confirm through the edge with the
curlcheck. No chain file is needed: Cloudflare’s edge recognizes its own CA without intermediates, though appending Cloudflare’s origin root to the.pemdoes no harm. The reference for the whole feature is developers.cloudflare.com/ssl/.
If you get 526 after the switch: either the hostname is missing from the certificate’s SAN list (deep subdomains like a.b.example.com are not covered by the default *.example.com), or the request is landing on a different vhost — typically a default server block holding an old self-signed certificate. Re-run the openssl check with -servername set to the exact failing hostname; whatever certificate comes back is the one Cloudflare sees. If you get 525, the origin is not completing a handshake at all — wrong port, firewall, or the reload never happened.
When this fix is wrong
If the hostname is, or might become, DNS-only — direct-access admin names, mail hosts, anything monitored or reached without the proxy — you want a publicly trusted certificate (Let’s Encrypt, AutoSSL) instead, because visitors bypassing Cloudflare will not trust an Origin CA certificate. The same goes for services on other ports (SMTP, IMAP, panel logins on 2083/8443): the Origin CA certificate is for the proxied web hop, nothing else.
Common mistakes
- Closing the creation dialog without saving the private key, then filing the certificate alone as “installed”.
- Installing the pair but leaving the zone on Flexible — the certificate sits unused while the origin hop stays plaintext.
- Forgetting the reload. Nginx and Apache keep serving the old certificate from memory until you reload or restart.
- Pasting the certificate into the key file or vice versa — the modulus check in the verify section catches this in seconds.
- Serving the Origin CA certificate on a hostname that later goes grey-cloud, and fielding “your site is not secure” reports from every visitor.
Prevention
Store the certificate and key in configuration management or a secrets vault so a server rebuild does not depend on someone’s clipboard from years ago. Record the expiry date in your inventory — fifteen years is long, not infinite, and shorter validities are common in regulated setups. When a new hostname is added to the vhost, check it against the certificate’s SAN list as part of the change, and regenerate the certificate with the extra name before the 526 finds you.
Getting end-to-end TLS right — edge, origin certificate, and the redirect chain — is standard work inside Managed Cloud Ops; book an infrastructure review if you want it verified end to end.