Open gotshadowbantempaccount opened 1 year ago
You want SNI?
right now just checking if 'cf-connecting-ip' header exist but need something "real" that can't be spoofed
cloudflare issue a Edge Certificates and in my opinion best way to (without bottleneck) "verify" certificate is to compare "thumbprint" or "SerialNumber"
Can you author a coherent message with a clear description of what why how you want here? Are you reporting a bug?
Need verify "client certificate" ( Cloudflare Origin Certificate, edge certyficate ) when its connecting to my nanoexpress that use uWebSockets.js
example varible like: req.clientcert.thumbprint or req.clientcert.SerialNumber
if ( req.clientcert.SerialNumber != 3938729374e719838' ) { res.end( 'not a Cloudflare user' ); }
somthing like in nginx ssl_client_certificate /etc/nginx/cloudflare.crt;
http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_client_certificate
whatever just add in cludflare header to verify in: "HTTP Request Header Modification" and checking value if exist by my secret key
If you use node 15.6.0 or later with uWebSockets.js you could get the identifier of a certificate using this code.
const crypto = require('crypto');
const getCertIdentifier = (cert, unique = true) => {
try {
const x509 = new crypto.X509Certificate(Buffer.from(cert));
return unique ? x509.fingerprint256 : x509.serialNumber;
} catch {
return null;
}
};
const identifier = getCertIdentifier('<cert in pem format>');
What is my problem: