I am trying to generate a server ssl certificate. The DNS is maintained on Cloudflare.
The lego
's help suggests the following syntax
CLOUDFLARE_EMAIL=anthony@mycompany.com \
CLOUDFLARE_API_KEY=ABCD1234 \
sudo lego --dns cloudflare --domains about.mycompany.com \
--email anthony@mycompany.com --path="/etc/lego" run
However the command returns the following error:
2018/04/19 02:19:45 CloudFlare credentials missing
It turns out the environment variables are not captured by the lego.
If I put the above (minus sudo
) in a shell script file (says getcert.sh
)
CLOUDFLARE_EMAIL=anthony@mycompany.com \
CLOUDFLARE_API_KEY=ABCD1234 \
lego --dns cloudflare --domains about.mycompany.com \
--email anthony@mycompany.com --path="/etc/lego" run
then run sudo bash ./getcert.sh
, the missing
error disappeared.
However it is replaced by the other error:
Error presenting token: Zone mycompany.com. not found in CloudFlare for domain _acme-challenge.about.mycompany.com.
How can fix this issue?
Получили ли вы свой ключ API для своего домена на Cloudflare?
Если вы не знаете, как, вот графическое руководство:
Шаг 1. Нажмите «Получить свой API» Ключ »на главной странице Cloudflare после входа в систему
Шаг 2: Нажмите« Просмотр », чтобы просмотреть свой ключ API (глобальный или зависящий от домена)
Шаг 3: Введите учетные данные в команде
CLOUDFLARE_EMAIL=youremail@example.com
CLOUDFLARE_API_KEY=yourcloudfalreAPIKey
lego --dns cloudflare --domains yourdomain.com \
--email youremail@example.com --path="/etc/lego" run