Authenticated Origin Pull Not working
I followed this article: https://developers.cloudflare.com/ssl/origin-configuration/authenticated-origin-pull/set-up/zone-level/
Spend entire day to figure this out only getting
Cloudflare Docs
Zone-level | Cloudflare SSL/TLS docs
When you enable Authenticated Origin Pulls for a zone, all proxied traffic to your zone is authenticated at the origin web server.
31 Replies
https://interlacekit.com/
The strange part is the authenticated pull works fine on my other domain which do not even show origin certificates in dashboard
but has authenticated pull enabled
If I disable the
ssl_verify_client on;
everything works fineIt "works fine" for the same reason why you can enable AOP (Auth. Origin Pulls) without breaking anything, just enabling it in Cloudflare doesn't do anything other then start serving it, and then your origin has to be specifically enabled tjo start verifying it
What do you mean "origin certs"? Origin Certs are completely seperate from AoP, did you download the certificate on that guide and which setup did you use?
Thanks for quick revert. Can you help understand how it works. My current understanding is:
You're just using the shared Auth. Origin Pull cert and enabling in the dash, you're not uploading your own/used api to enable?
I first tried using my cert CSR and KEY via terraform to issue Origin CA Certificate. But currently trying to do it manually using Cloudflare's managed CSR and KEY to issue it
Also for Origin Pull i did upload the the CA cert from CLF to my server. Also enabled the tls client auth via API.
The origin CA cert stuff is unlikely to be your issue unless your SSL/TLS Mode is "Flexible" or "Off"
Should be Full (Strict)
The SSL mode is strict. Again if i disable the verifiy client on nginx it works fine
You can enable nginx custom log format to log the mTLS/Client cert as well, something like:
so you don't need to break your site in order to see if CF is serving the cert or not
okay let me try this.
btw you'd want
ssl_verify_client optional;
so the cert gets requested and verified if it does exist
not getting anything
would make sense why you got that error
in the dash you see AoP enabled for that specific zone? You've never used the per-hostname api/config?
Oh.. should I be setting up per host instead of zone level?
no but it's an option which would override this
should be
settings/tls_client_auth
not origin_tls_client_auth, curiousis it possible i might have override some zone level settings with terraform settings overrides?
let me try this one
in a few different ways. configuration rules can override ssl mode for example
/zones/<zoneId>/settings/tls_client_auth
is the normal universal one
/zones/{zone_id}/origin_tls_client_auth/
is the sub-path all the per hostname settings are under.
You could try seeing if you have overriden it for your apex https://developers.cloudflare.com/api/operations/per-hostname-authenticated-origin-pull-get-the-hostname-status-for-client-authentication and if you have any custom ones https://developers.cloudflare.com/api/operations/per-hostname-authenticated-origin-pull-list-certificatesCloudflare API Documentation
Interact with Cloudflare's products and services via the Cloudflare API
Cloudflare API Documentation
Interact with Cloudflare's products and services via the Cloudflare API
Noted
Correct me If i'm wrong. Regardless of ssl certificates configuration on my server I should see Origin Pull logs in nginx logs.
Or do they matter only for CA cert?
I don't understand the question
"regardless of ssl cert configuration"?
AoP is just mTLS so as the bare min your origin web server needs to be requesting the client cert
I was specifically talking about ssl mode because Off/Flexible is HTTP (not https) and Flexible is the semi-default, and of course without https not going to get a client cert
Got it.
So if strict mode is working. then there some miss configuration at Zone level?
The same verification CA cert is working with other domain.
it's working with another domain in the sense that the "other domains" web server is verifying the mtls cert (ssl_verify_client) and you can see it in logs?
yes
its working with other domain
cool, then you have a working setup to compare to. Yea I'd check out the config fully, could try running the url through the Trace tool account level and see what you match
Im trying over again manually to replicate the config
No its not working. Something is wrong with zone settings. Is there any way to reset the zone
no way to reset without removing and waiting 7 days. Did you try tracing like I said above, and the get hostname config/certs for aop endpoints?
trying trace. don't want to setup per host but will give it try as well
I mean look at the overall flow, did it hit any config rules overriding ssl/any specific rules of interest?
no there's no rule hit in trace
After configuring per host the aop requests are working.
Now getting 400 Bad Request
The SSL certificate error
nginx
Wooho..
Go it working..
Thanks @Chaika for the help..
š