mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 17:35:52 +03:00
[GH-ISSUE #680] Cannot get Let's Encrypt cert via cloudflare dns challange #575
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#575
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Chachu1 on GitHub (Oct 29, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/680
I have set a brand new NPM container and I am trying to get SSL certs but keep failing,
Below is the error i get in the logs
I don't know which part I am missing
Can you please guide me
@ikomhoog commented on GitHub (Nov 3, 2020):
I'm having the same problem, only I'm trying to request a wildcard certificate.
In tutorials on how to do this there are ini files that need to be edited.
Is that also the case for Nginx-Proxy-Manager?
If so, where are these files located?
@ikomhoog commented on GitHub (Nov 3, 2020):
Update: went to test some more and found a temporary solution.
the token doesn't work, but the less secure email and key combination work.
instead of the
we need to use
so there might be something wrong with either the token implementation or the cloudflare API (which was down last night).
I hope this helps further debugging.
@ikomhoog commented on GitHub (Nov 3, 2020):
Update: While I have it working I do get an error:
which is weird because this is my file:
@chaptergy commented on GitHub (Nov 3, 2020):
This is a separate problem described in https://github.com/jc21/nginx-proxy-manager/issues/662. The fix is merged however there was no release since then.
@chaptergy commented on GitHub (Nov 3, 2020):
Is someone able to verify, that this problem is fixed when using image
jc21/nginx-proxy-manager:github-pr-687? Just change the tag:latesttogithub-pr-687in your docker-compose file.@jc21 commented on GitHub (Nov 3, 2020):
Just wanting to thank you @chaptergy for your continued support. I really haven't had time to do anything but read emails lately and it's great to see community members like yourself helping out :) great work!
@potvinp commented on GitHub (Nov 4, 2020):
This seems to have no effect on the issue, at least on my end. Also doing this nuked my entire configuration, which was unfortunate but crap happens.
@chaptergy commented on GitHub (Nov 4, 2020):
Unfortunately I am unable to debug this, since I do not have any domains at Cloudflare or domains I could quickly transfer to cloudflare to test this. Is there someone willing to help me debug this, or someone willing to provide me with a Cloudflare token with
Zone:DNS:Editpermission for some random (sub)domain so I can debug this myself?@ikomhoog commented on GitHub (Nov 4, 2020):
I set up a second npm container with the same parameters (except the paths) on my system.
I'm getting a new error about npm not being able to create a folder (or a file in a folder it didn't create)
The letsencrypt folder is rather empty compared to my main npm folder.
when I let UnRaid alter the rights for the /etc/letsencrypt folder it still gives this error, when I then create the credentials folder myself it accepts it and goes through with creating the other missing folders.
I tested this a few times, and it is reproducible on the pr version, the release version does not have this error.
the request still fails with the same error as before:
@ikomhoog commented on GitHub (Nov 4, 2020):
Update: I can't read, i was trying to use my global-api-KEY as the token, i assumed they would be interchangeable.
While creating a token for @chaptergy it suddenly dawned on me that it might not be a global-api-token.
this confusion probably came from the spaceinvaderone tutorial where he uses the key and e-mail instead of a token.
Sorry for taking your time, the token works like it should.
@Chachu1 and @potvinp can you also confirm this?
https://support.cloudflare.com/hc/en-us/articles/200167836-Managing-API-Tokens-and-Keys
@chaptergy commented on GitHub (Nov 4, 2020):
Thanks for testing! I assume you tested on tag
:github-pr-687?@ikomhoog commented on GitHub (Nov 4, 2020):
Yes I tested on tag
:github-pr-687But just to be clear, the token also works on both release and pr (at least for me).
I think we were all just using the global-API-key instead of a token.
The credentials folder part is on pr only, I have only tested it github-pr-687 and release and it is reproducible.
@potvinp commented on GitHub (Nov 4, 2020):
I have been trying to use the API token that I generated with the
Zone:DNS:Editpermission and I haven't had any luck. Just for giggles I tried the global key itself and that still didn't work, which I expected.I'll test again later once I'm off work and then update.
@ikomhoog commented on GitHub (Nov 4, 2020):
@potvinp have you already pointed the (sub)domain you are trying to get a cert for to your IP address?(since this is a requirement for DNS challenges)
Does everything work without SSL certificates?
Did you try the key with these lines(notice that it's not "token" but "key" here):
since the key requires an e-mail
I'm trying to spot a difference in our setups.
I'm using google domains for my domain and only use Cloudflare for the DNS and certificates since I could get a wildcard certificate there.
I haven't done anything special during that setup:
Change the nameservers to the Cloudflare ones
Add all the subdomains that I want in the DNS section(my domain is 1 A Record for the base and all CNAMEs for the subdomains)
Setup ddclient so my domain points to my IP
Request the certificate
and it all works like it should when I actually use the correct token.
What does your setup look like?
That will make it easier to debug where the problem might come from.
Can you post the error you get?
There might be slight differences compared to my errors that will point us in the right direction.
@chaptergy commented on GitHub (Nov 5, 2020):
I have updated the PR with some additions to make sure the
nonexistent directorydoes not happen. I am now no longer able to produce this error on:github-pr-687. Furthermore I have been provided an API token for Cloudflare and I have been able to create a certificate successfully using this token every time on the current:github-pr-687build.@ikomhoog commented on GitHub (Nov 5, 2020):
I have also tested it and it all works as expected, no directory error on a clean install, and the token works every time.
@Chachu1 commented on GitHub (Nov 5, 2020):
@Chachu1 commented on GitHub (Nov 5, 2020):
Sorry guyz click on the wrong button...
I tried @ikomhoog suggestion and yes the issue was actually the global API key and the token confusion.
If you use the token it works properly and on the
:latesttag as well.Thank you for helping out 👍
If anyone in future gets here looking for an answer;
You need and API token, this is different from your global API key,
https://developers.cloudflare.com/api/tokens/create <--- follow this link to create a token
You can use "Edit Zone DNS" template.
@chaptergy commented on GitHub (Nov 6, 2020):
Great, I'm glad it's working! :)
If this issue is resolved, please go ahead and close it. Thanks!
@koshia commented on GitHub (Feb 26, 2021):
I hate to bring a closed issue back to life and it may be something on Cloudflare's end but can someone confirm for me that I don't need the TXT records created ahead of time in my DNS Zones when using Cloudflare option? I'm looking at the log when it tries to go out and register letsencrypt - it creates the two TXT records and then deletes it but then fails the challenge. If I set up the TXT records, it wouldn't match when I resubmit the registration through NPM. Single subdomain works, whole domain and wildcard via DNS Challenge fails via the Zone EDIT API method.
@JoahZhang commented on GitHub (Aug 7, 2023):
I figured out this problem,I am created an api_key in cloudflare, use the key you just generated , be careful is not the global key.
@Becase commented on GitHub (Oct 18, 2023):
Thanks, it works~