Unable to retrieve my ssl certificate

sudo docker-compose ps

ubuntu_caddy_run_9ed0eb03937a   caddy run --config /etc/ca ...   Up      2019/tcp, 443/tcp, 80/tcp   

docker-compose all

 docker-compose.yml

version: '3.9'
services:

  # Django website

  website:
    build: website/
    container_name: website
    volumes:
      - ./website:/code/
      - ./static:/code/staticfiles
      - ./media:/code/media
    expose:
      - 8000
    command: bash -c "cd /code/ && ls && python3 manage.py collectstatic --no-input && python3 manage.py makemigrations && python3 manage.py migrate && gunicorn --w>
    links:
      - postgres

  # DATABASE django website

  postgres:
    image: postgres:14-alpine
    container_name: postgres
    ports:
      - 5432
    volumes:
      - ./data/db:/var/lib/postgresql/data
    environment:
      - "POSTGRES_NAME=postgres"
      - "POSTGRES_USER=postgres"
      - "POSTGRES_PASSWORD=&kasemap!0-q8!"

  # Serv django website

  caddy:
    image: caddy:2.5.1-alpine
    container_name: caddy
    ports:
      - 80
      - 443
    links:
      - website
    volumes:
      - /home/ubuntu/caddy/Caddyfile:/etc/caddy/Caddyfile
      - ./media:/srv/media/
      - ./static:/srv/static/
      - caddy_data:/data
      - caddy_config:/config

volumes:
  caddy_data:
  caddy_config:

Oh, I think you might not be binding the ports to the host. You need to do - "80:80" and - "443:443"

You had that correct in your earlier posts.

It was like this before - "80:80" and - "443:443" , this was a test but I wonder, it may be the firewall as it is allow in

I just reset the DNS zone and added the server, here are the new caddy logs:

{"level":"error","ts":1652031612.3567255,"logger":"tls.obtain","msg":"could not get certificate from issuer","identifier":"mathieudamotalongo.fr","issuer":"acme-v02.api.letsencrypt.org-directory","error":"HTTP 400 urn:ietf:params:acme:error:connection - 51.254.120.199: Connection refused"}
{"level":"info","ts":1652031624.5901248,"logger":"tls.issuance.acme.acme_client","msg":"trying to solve challenge","identifier":"mathieudamotalongo.fr","challenge_type":"http-01","ca":"https://acme.zerossl.com/v2/DV90"}
{"level":"info","ts":1652031631.454664,"logger":"tls.issuance.acme.acme_client","msg":"trying to solve challenge","identifier":"www.mathieudamotalongo.fr","challenge_type":"http-01","ca":"https://acme.zerossl.com/v2/DV90"}
{"level":"error","ts":1652031937.7273314,"logger":"tls.obtain","msg":"could not get certificate from issuer","identifier":"mathieudamotalongo.fr","issuer":"acme.zerossl.com-v2-DV90","error":"[mathieudamotalongo.fr] solving challenges: [mathieudamotalongo.fr] authorization took too long (order=https://acme.zerossl.com/v2/DV90/order/29oFQz5OzS8wNvOFTEDoGw) (ca=https://acme.zerossl.com/v2/DV90)"}
{"level":"error","ts":1652031937.7273753,"logger":"tls.obtain","msg":"will retry","error":"[mathieudamotalongo.fr] Obtain: [mathieudamotalongo.fr] solving challenges: [mathieudamotalongo.fr] authorization took too long (order=https://acme.zerossl.com/v2/DV90/order/29oFQz5OzS8wNvOFTEDoGw) (ca=https://acme.zerossl.com/v2/DV90)","attempt":2,"retrying_in":120,"elapsed":748.967873184,"max_duration":2592000}
{"level":"error","ts":1652031944.322218,"logger":"tls.obtain","msg":"could not get certificate from issuer","identifier":"www.mathieudamotalongo.fr","issuer":"acme.zerossl.com-v2-DV90","error":"[www.mathieudamotalongo.fr] solving challenges: [www.mathieudamotalongo.fr] authorization took too long (order=https://acme.zerossl.com/v2/DV90/order/CNHF8SF8eoJ7Lhh6396SeA) (ca=https://acme.zerossl.com/v2/DV90)"}
{"level":"error","ts":1652031944.3222587,"logger":"tls.obtain","msg":"will retry","error":"[www.mathieudamotalongo.fr] Obtain: [www.mathieudamotalongo.fr] solving challenges: [www.mathieudamotalongo.fr] authorization took too long (order=https://acme.zerossl.com/v2/DV90/order/CNHF8SF8eoJ7Lhh6396SeA) (ca=https://acme.zerossl.com/v2/DV90)","attempt":2,"retrying_in":120,"elapsed":755.574977128,"max_duration":2592000}

I’m not really sure what to tell you at this point, tbh. I don’t see an issue with Caddy. Something’s misconfigured with your network setup. Maybe get help from your VPS provider.

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.