title: Traefik/SSL/LetsEncrypt Faulty
body: <p>I'm trying to set up letsEncrypt with traeffik and whatever I do it appears not to work. At the moment I'm getting the following error: </p>
  
  <p><a href="https://i.stack.imgur.com/j93pi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j93pi.png" alt="enter image description here"></a></p>
  
  <p>Other SO posts have mentioned that this may be due to not using the http challenge for traeffik (<a href="https://stackoverflow.com/questions/48408184/traefik-will-issue-certificate-instead-of-lets-encrypt?rq=1">Traefik will issue certificate instead of Let&#39;s encrypt</a>), but I'm using that so I have no idea honestly (this doesn't solve the issue - do not close). My configuration files appear to be small, but I'm getting no error feedback so my ability to iterate on breaks is small. If anyone can provide any help on how to fix this I would appreciate it - I've been at this for a while and I'm at a loss for what to do.</p>
  
  <p>I spin up the following three files below using this small bash script:</p>
  
  <pre><code>root@ubuntu-1gb-nyc3-01:/lowteck# cat ./runSwarm.sh 
  #!/bin/bash
  
  ./buildandpush.sh
  cd ./back
  ./buildandpush.sh
  cd ..
  
  docker volume prune -f
  docker kill $(docker ps -q)
  docker rm $(docker ps -a -q)
   docker swarm init \
     --advertise-addr 104.236.214.151
  docker network create -d overlay --attachable proxy
  docker stack deploy --compose-file=stage.yaml prod2 
  docker stack deploy --compose-file=traefik.yaml prodTraefik
  </code></pre>
  
  <p>Here is my <code>traefik.toml</code>:</p>
  
  <pre><code>root@ubuntu-1gb-nyc3-01:/lowteck# cat traefik.toml 
  logLevel = "DEBUG"
  defaultEntryPoints = ["http", "https"]
  
  [web]
  
  [entryPoints]
    [entryPoints.http]
    address = ":80"
    [entryPoints.http.forwardedHeaders]
      trustedIPs = ["104.236.214.151"]
    [entryPoints.https]
    address = ":443"
      [entryPoints.https.tls]
  
  [acme]
    caServer = "https://acme-v02.api.letsencrypt.org/directory"
    email = "pweyand@gmail.com"
    storage = "acme.json"
    entryPoint = "https"
    onHostRule = true 
    [acme.httpChallenge]
      entryPoint = "http"
  
  [[acme.domains]]
    main = "lowteck.com"
    sans = ["www.lowteck.com"]
  
  [docker]
    domain = "traefik"
    watch = true
    swarmmode = true
    network="web"
  </code></pre>
  
  <p>Here is my <code>traefik.yaml</code>:</p>
  
  <pre><code>root@ubuntu-1gb-nyc3-01:/lowteck# cat traefik.yaml 
  version: '3.3'
  
  networks:
    proxy:
      external: true
  
  configs:
    traefik.toml:
      file: ./traefik.toml
  
  services:
  
    traefik:
      image: traefik
      ports:
        - "80:80"
        - "8080:8080"
        - "443:443"
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock
      configs:
        - source: traefik.toml
          target: /etc/traefik/traefik.toml
      labels:
        - "traefik.enable=false"
      networks:
        - proxy
      deploy:
        replicas: 1
        placement:
          constraints: [node.role == manager] 
  </code></pre>
  
  <p>Here is my <code>stage.yaml</code>:</p>
  
  <pre><code>root@ubuntu-1gb-nyc3-01:/lowteck# cat stage.yaml 
  version: "3.3"
  
  networks:
    default:
      external: false
    proxy:
      external: true
  
  services:
    back:
      image: patientplatypus/lowtechback:latest
      ports: 
        - '5000:5000'
      networks:
        - proxy
        - default
      deploy:
        replicas: 1
        restart_policy:
          condition: on-failure
          max_attempts: 5
          window: 120s
        labels:
          - "traefik.docker.backend=back"
          - "traefik.port=5000"
          - "traefik.frontend.rule=Host:back.lowteck.com"
          - "traefik.docker.network=proxy"
    front:
      image: patientplatypus/lowtechfront:latest
      ports: 
        - '3000:3000'
      networks:
        - proxy
        - default
      depends_on:
        - back
      deploy:
        replicas: 1
        restart_policy:
          condition: on-failure
          max_attempts: 5
          window: 120s
        labels:
          - "traefik.docker.backend=front"
          - "traefik.port=3000"
          - "traefik.frontend.rule=Host:104.236.214.151, lowteck.com, www.lowteck.com, zennify.me"
          - "traefik.docker.network=proxy"
  </code></pre>
  
  <p>Again, I've been at this for a while, and I have essentially no error codes on which to go on. If anyone has any advice please let me know.</p>
  
  <p>EDIT: </p>
  
  <p>I found an error after logging out the traefik pod - namely that I needed:</p>
  
  <pre><code>[[acme.domains]]
    main = "lowteck.com"
    sans = ["www.lowteck.com", "back.lowteck.com"]
  </code></pre>
  
  <p>However this has not solved the https problem although the logs are now clear for the traefik container. You can see the full log output here: <a href="https://gist.github.com/patientplatypus/8a40e12c6ba64cdc7d2bf88581967057" rel="nofollow noreferrer">https://gist.github.com/patientplatypus/8a40e12c6ba64cdc7d2bf88581967057</a>.</p>