-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't issue an ssl certificate for domains proxied by Cloudflare #258
Comments
If your site is behind CloudFlare proxy, the best option is to not use Let’s Encrypt at all, but instead to use Cloudflare’s Origin CA: https://blog.cloudflare.com/cloudflare-ca-encryption-origin/ |
@gjongenelen I failed to mention that I'm trying to generate certificates for multiple domains and just some of them are on Cloudflare. I apologize for that :( . Is there a way to generate a certificate for both, proxied and not proxied domains (through Crowdrole or any other dns console/proxy provider) ? |
Do you have "Always SSL/HTTPS" option enabled in Cloudflare. Depending on your config, this may create issues as cloudflare will forward acme challenges to your HTTPS handler. |
Oh, turning "Always SSL/HTTPS" off fixed it! Can you give me more info regarding the last part of your answer: "Depending on your config, this may create issues as cloudflare will forward acme challenges to your HTTPS handler" - how can it be configured in a way that would allow me to use "Always SSL/HTTPS"? Thanky you! :D |
You probably have:
in your http (tcp/80) handler. I think copying this block to your https-handler would fix the issue. Please copy/duplicate and don't remove it from the http-handler, as let's encrypt will still use the http-handler for domains which aren't proxied via cloudflare. |
Hey @gjongenelen , thank you so much for helping me (and hopefully others) but unfortunatelly that one didn't work (copy/paste the acme challenge location block from port 80 to 443) , i still can't issue certificates for domains that have "Always use https" enabled on cloudflare. Any other ideas? Thank you! 😄 |
This will probably wont work, letsencrypt always connects on http for challenge url. Best way i see it is to introduce dns validation and skip certificate generation for those domains that do not have correct entries. lua-resty-dns module can be used |
My guess was that the "Always SSL/HTTPS" setting was redirecting the challenges to the https-handler. DNS validation would be a better option indeed. |
Any idea how one could do on-the-fly DNS validations and not try to generate certificates for those proxied calls ? Would it be adding custom code in allow_domain function ? |
Sorry to hijack the post, but we're facing a similar issue. We've just moved over from Route53 to CloudFlare and have now turned on DNS proxy. With proxy turned on we get a similar "ERR_SSL_VERSION_OR_CIPHER_MISMATCH" error for custom domains that we pass via our openresty auto SSL EC2 server to have the SSL certificate created. I've tried turning off the "Always SSL/HTTPS" setting but that didn't seem to make a difference. We are also doing a DNS lookup in our lua script, so I'm not sure if that makes a difference. I don't suppose anyone has any suggestions for other things we might want to check? |
Hi Benjamin ,
Cloudflare also uses Letsencrypt to issue the certificates. So in case if
you have already issued a certificate using letsencrypt , there is a high
probability of cloudflare not issuing the certificate for same domain .
Few options :
- Import your cert and pem in cloudflare as custom certificate
- Dont use autossl in backend for endpoints using cloudflare
- revoke the certificate generayed by autossl enabling cloudflare to issue
the certificate
Let know if you require technical support for it
Thanks & Regards,
Abhishek Sharma
…On Fri, 27 Jan 2023, 8:16 pm Benjamin Dell, ***@***.***> wrote:
Sorry to hijack the post, but we're facing a similar issue. We've just
moved over from Route53 to CloudFlare and have now turned on DNS proxy.
With proxy turned on we get a similar "ERR_SSL_VERSION_OR_CIPHER_MISMATCH"
error for custom domains that we pass via our openresty auto SSL EC2 server
to have the SSL certificate created.
I've tried turning off the "Always SSL/HTTPS" setting but that didn't seem
to make a difference.
We are also doing a DNS lookup in our lua script, so I'm not sure if that
makes a difference.
I don't suppose anyone has any suggestions for other things we might want
to check?
—
Reply to this email directly, view it on GitHub
<#258 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHU3WWMXLW5A3BIUHBSU3ZTWUPNTTANCNFSM45VJ6NAA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Amazing, thanks Abhishek. Just wanted to clarify a couple of things if that's OK. I don't think we actually created a cert and pen on our EC2 SSL server (the one that uses auto SSL to generate SSL certs for our customers custom domains). Or will there be one on the server that im not aware of? I'd be interested in some technical help if that's OK? Is that something I can pay you for perhaps? |
Autossl generates a certificate and keeps it on a local server. Location is dependent on configuration. For default file storage you can find in some subidrectory of /etc/resty-auto-ssl location. You can run locate or find command to search the certificate |
Thanks - I've just sent you an email to see if you're able to help directly. |
Hello!
I was playing around with
lua-resty-auto-ssl
and everything worked perfectly until I tried issuing a certificate for a domain proxied by Cloudflare (orange cloud).This is/are the error/s that I'm getting for the domain that is proxied:
Here is my
nginx.conf
(pretty much the default one but I'm usingredis
to store the ssl certificates):After trying once to issue the ssl certificate for the proxied domain this is what I have in redis:
And...again, if I use
DNS only
instead ofProxied
the ssl certificate is issued without a problem.Can somebody help me understand what's happening? Is there something that I can change/implement in order to allow both proxied/dns only domains to get their own ssl certificate?
Thank you! :D
The text was updated successfully, but these errors were encountered: