Skip to content
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

Cloudflare DNS verification - credential information missing #785

Closed
ghost opened this issue Feb 6, 2019 · 7 comments
Closed

Cloudflare DNS verification - credential information missing #785

ghost opened this issue Feb 6, 2019 · 7 comments

Comments

@ghost
Copy link

ghost commented Feb 6, 2019

lego dnshelp recommends the following command to use dns verification:

CLOUDFLARE_EMAIL=foo@bar.com \
CLOUDFLARE_API_KEY=b9841238feb177a84330febba8a83208921177bffe733 \
lego --dns cloudflare --domains www.example.com --email me@bar.com run

However, when I run that (with the appropriate values), I get the following error:
cloudflare: some credentials information are missing: CLOUDFLARE_EMAIL,CLOUDFLARE_API_KEY

Cloudflare is the DNS provider I am using. What am I doing wrong?

@ldez
Copy link
Member

ldez commented Feb 6, 2019

I checked the command and it works for me:

$ CLOUDFLARE_EMAIL=foo@bar.com \
CLOUDFLARE_API_KEY=b9841238feb177a84330febba8a83208921177bffe733 \
lego --dns cloudflare --domains www.example.com --email me@bar.com run

2019/02/06 02:39:58 No key found for account me@bar.com. Generating a curve P384 EC key.
2019/02/06 02:39:58 Saved key to ~/.lego/accounts/acme-v02.api.letsencrypt.org/me@bar.com/keys/me@bar.com.key
2019/02/06 02:39:58 Please review the TOS at https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf
Do you accept the TOS? Y/n
y
2019/02/06 02:40:00 [INFO] acme: Registering account for me@bar.com
!!!! HEADS UP !!!!

                Your account credentials have been saved in your Let's Encrypt
                configuration directory at "~.lego/accounts".
                You should make a secure backup of this folder now. This
                configuration directory will also contain certificates and
                private keys obtained from Let's Encrypt so making regular
                backups of this folder is ideal.2019/02/06 02:40:01 [INFO] [www.example.com] acme: Obtaining bundled SAN certificate
2019/02/06 02:40:02 [INFO] [www.example.com] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/JcDVNcyD7dDPnTPDSzka14i8umTk8W8XfV9Ixi3ac-Q
2019/02/06 02:40:02 [INFO] [www.example.com] acme: Could not find solver for: tls-alpn-01
2019/02/06 02:40:02 [INFO] [www.example.com] acme: Could not find solver for: http-01
2019/02/06 02:40:02 [INFO] [www.example.com] acme: use dns-01 solver
2019/02/06 02:40:02 [INFO] [www.example.com] acme: Preparing to solve DNS-01
2019/02/06 02:40:03 [INFO] [www.example.com] acme: Cleaning DNS-01 challenge
2019/02/06 02:40:04 [WARN] [www.example.com] acme: error cleaning up: cloudflare: failed to find zone example.com.: ListZones command failed: error from makeRequest: HTTP status 403: insufficient permissions 
2019/02/06 02:40:04 Could not obtain certificates:
        acme: Error -> One or more domains had a problem:
[www.example.com] [www.example.com] acme: error presenting token: cloudflare: failed to find zone example.com.: ListZones command failed: error from makeRequest: HTTP status 403: insufficient permissions

@ghost
Copy link
Author

ghost commented Feb 6, 2019

Strange. I even tried putting it in a script and executing it that way, but I still get the same error. I'm using lego v2.1.0 (i386).

@ldez
Copy link
Member

ldez commented Feb 6, 2019

In a script you have to export the vars:

#!/usr/bin/env sh

export CLOUDFLARE_EMAIL=foo@bar.com
export CLOUDFLARE_API_KEY=b9841238feb177a84330febba8a83208921177bffe733

lego --dns cloudflare --domains www.example.com --email me@bar.com run

or

#!/usr/bin/env sh

CLOUDFLARE_EMAIL=foo@bar.com \
CLOUDFLARE_API_KEY=b9841238feb177a84330febba8a83208921177bffe733 \
lego --dns cloudflare --domains www.example.com --email me@bar.com run

@ghost
Copy link
Author

ghost commented Feb 6, 2019

Yeah, this doesn't make sense to me. I tried both, I get the same result for each. cloudflare: some credentials information are missing: CLOUDFLARE_EMAIL,CLOUDFLARE_API_KEY

@ldez
Copy link
Member

ldez commented Feb 6, 2019

Have you tried to simply copy/paste my samples? (with the fake email, key, etc. without changing anything)

@ldez
Copy link
Member

ldez commented Feb 7, 2019

@andyforceno any news?

@ghost
Copy link
Author

ghost commented Feb 8, 2019

Have you tried to simply copy/paste my samples? (with the fake email, key, etc. without changing anything)

Yes, this worked. This issue is resolved, thanks.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant