CloudFlare has an Authenticated Origin
Pulls mode where
requests to your origin servers present a CloudFlare issued certificate. This
module helps you verify requests to your Node server came from CloudFlare
without needing to change how your own SSL certificate is served.
This module has been tested with Node.js 0.10 and above.
The cloudflare-origin-pull module exports a verify() method. Call it with
the peer certificate, if any. It verifies whether the certificate was issued by
CloudFlare and if it has not yet expired, returning a boolean. verify() does
not throw errors and can be called without a certificate (it'll return false).
Simply destroy the client connection if the certificate was not from CloudFlare
or no certificate was presented at all.