Hello, i run a small webserver in a docker container. I can visit the website with the ip address and also with the domain (let's say, sub.domain.com).
Now i want too use https with lets encrypt. I deployed a docker-compose file like this:
version: '2'
services:
letsencrypt:
image: linuxserver/letsencrypt
container_name: letsencrypt
ports:
- 443:443
volumes:
- /opt/appdata/letsencrypt/config:/config
restart:
always
environment:
- PUID=1050
- PGID=1050
- EMAIL=mail@domain.com
- URL=sub.domain.com
- TZ=Europe/Berlin
- VALIDATION=dns
- DNSPLUGIN=route53
On a different server i already run successfully letsencrypt, but on this server it's not running in docker but native. I need the dns challenge, as the service runs behind a firewall. The DNS challenge works perfect with route53 in aws with this command: sudo certbot -d sub.domain.com --manual --preferred-challenges dns certonly
After that i registered a txt record in route 53 and everything works. Now i want to do the same with docker.
So i added
- VALIDATION=dns
- DNSPLUGIN=route53
in the docker-compose.yml file. But after running docker-compose up -d
i'll get
...
Created donoteditthisfile.conf
No subdomains defined
E-mail address entered: mail@domain.com
dns validation via route53 plugin is selected
Generating new certificate
Use of --manual-public-ip-logging-ok is deprecated.
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Credentials found in config file: /config/dns-conf/route53.ini
Plugins selected: Authenticator dns-route53, Installer None
Account registered.
Requesting a certificate for sub.domain.com
Performing the following challenges:
dns-01 challenge for sub.domain.com
Cleaning up challenges
An error occurred (InvalidClientTokenId) when calling the ListHostedZones operation: The security token included in the request is invalid.
To use certbot-dns-route53, configure credentials as described at https://boto3.readthedocs.io/en/latest/guide/configuration.html#best-practices-for-configuring-credentials and add the necessary permissions for Route53 access.
ERROR: Cert does not exist! Please see the validation error above. Make sure you entered correct credentials into the /config/dns-conf/route53.ini file.
So whats next?