Origin CA: a certificate between Cloudflare and the educational server

A local key and CSR, a separate SSL token and an exact-hostname certificate. Separate browser TLS from the Cloudflare-to-origin connection.

Two bridge spans with a cloud and a seal; a key rests beside the laptop.
Two bridge spans with a cloud and a seal; a key rests beside the laptop.

Two TLS connections rather than one

The educational Symfony application already responds through a private loopback origin. Before connecting its hostname to Cloudflare, I prepared a certificate for the second part of the path: Cloudflare → Nginx on E-01. Browser → Cloudflare uses an edge certificate. These are separate TLS connections with separate certificates.

A separate token for SSL operations

For this step I created a new user API token: SSL and Certificates: Edit plus Zone: Read for solution200.com only, with expiry before the temporary server rental ends. The DNS and Worker tokens remained separate. SSL Edit covers the corresponding operations across the selected zone, not just one hostname or only Origin CA issuance. An exact name narrows certificate use, but does not narrow the token’s IAM permissions.

Cloudflare Origin CA

The private key stays local

I generated a 2048-bit RSA key and CSR in a private directory on my computer. Only the CSR, containing the public key, went to Cloudflare. The private key belongs on the future HTTPS origin; it is absent from API arguments, response logs and browser frames. Below are csr.conf and commands for reproducing the operation from the TLS file directory.

[req]
prompt=no
distinguished_name=dn
req_extensions=extensions
[dn]
CN=e01-demo.solution200.com
[extensions]
subjectAltName=DNS:e01-demo.solution200.com
umask 077
openssl req -new -newkey rsa:2048 -nodes -sha256 \
  -config csr.conf \
  -keyout e01-demo-origin.key \
  -out e01-demo-origin.csr

What the CSR signature verifies

Before submission, I checked the request’s own signature. OpenSSL returned the line below. This checks CSR integrity and the signature made with its key; it does not yet mean that a trusted authority has signed a certificate or that the server serves HTTPS.

openssl req -in e01-demo-origin.csr -verify -noout
Certificate request self-signature verify OK

Issuing one certificate

Through POST /certificates, I requested origin-rsa, exactly one hostname, e01-demo.solution200.com, and 30 days of validity. I did not include an apex or wildcard. Before creation, I read the complete existing certificate inventory for the zone to avoid an unnecessary certificate for this name. Cloudflare returned HTTP 200. The JSON below contains only selected fields from the actual response: the certificate PEM, identifier and calendar fields are omitted.

{
  "success": true,
  "result": {
    "hostnames": [
      "e01-demo.solution200.com"
    ],
    "request_type": "origin-rsa",
    "requested_validity": 30
  }
}

Cloudflare API: Create Certificate

SAN, key correspondence and CA trust

I checked the issued certificate’s single DNS SAN, compared its public key with the private key’s public component and verified its signature using the official Origin CA RSA root. I obtained the root file from Cloudflare’s official documentation repository and pinned its checksum. The sslserver purpose check runs locally; it does not establish an installed TLS listener on E-01. The commands and selected OpenSSL response lines follow.

openssl x509 -in e01-demo-origin.crt -noout -ext subjectAltName
openssl verify -CAfile cloudflare-origin-rsa-root.pem \
  -purpose sslserver \
  -verify_hostname e01-demo.solution200.com \
  e01-demo-origin.crt
X509v3 Subject Alternative Name:
    DNS:e01-demo.solution200.com
e01-demo-origin.crt: OK

Repeating verification through the CLI

After manual issuance, I prepared origin-ca inspect for the existing local files. It first checks the key, exact SAN, validity period and chain to the explicitly selected root. It then verifies the token and zone, reads the complete certificate inventory and retrieves the specific certificate through the API. CA_SHA256 must contain the recorded fingerprint of the trusted PEM file; a new file with the same name must not become automatically trusted. The command inspects existing material; it neither issues nor revokes certificates.

deploy-cli cloudflare origin-ca inspect \
  --env-file "$HOME/.secrets/solution200.com/cloudflare/origin-ca-e01.env" \
  --zone solution200.com --hostname e01-demo.solution200.com \
  --certificate-file "$PWD/e01-demo-origin.crt" \
  --private-key-file "$PWD/e01-demo-origin.key" \
  --ca-file "$PWD/cloudflare-origin-rsa-root.pem" \
  --ca-sha256 "$CA_SHA256" \
  --output-file "$PWD/origin-certificate-inspection.json"

Why the browser cannot use this origin yet

Origin CA establishes trust between Cloudflare and the origin. An ordinary browser need not trust that root when connecting directly to the server. A PEM file also does not open a port or configure Nginx. At this stage the certificate remained local; I changed no DNS records, Worker routes, server listeners or Strict zone mode. A protected HTTPS vhost, password and network rules come before connecting DNS.

  1. Operations & Security HTTPS and a password for E-01: Nginx, Origin CA and Symfony
  2. Platform Engineering Private Symfony on E-01: the Nginx → FPM → application path
  3. Platform Engineering The domain and Cloudflare before connecting E-01
  4. Operations & Security A separate Cloudflare DNS token for the educational E-01

A project by the author · Weather Solution200

After reading, a look outside.

Temperature, rain and wind in your city. Check the forecast and plan the hours ahead.

Check the forecast
Next article