Dashboard not using certificate

I found a post here on the forums by ldez where he showed a docker-compose setup from Traefik that looked almost like mine, so I checked it out and changed mine to this:

  traefik:
    image: traefik
    container_name: traefik
    restart: unless-stopped
    command:
      - --log.level=DEBUG
      - --log.filePath=./appdata/traefik/traefik.log
      - --accessLog.filePath=etc/traefik/log/access.log
      - --accessLog.bufferingSize=100
    
      - --providers.docker=true
      - --providers.docker.exposedbydefault=false

      - --api
      - --api.insecure=true
      
      - --entrypoints.traefik.address=:8888

      - --entrypoints.web.address=:80
      - --entrypoints.web.http.redirections.entrypoint.to=websecure
      - --entrypoints.web.http.redirections.entrypoint.scheme=https

      - --entrypoints.websecure.address=:443
      - --entrypoints.websecure.http.tls.certresolver=cloudflare

      - --certificatesresolvers.cloudflare.acme.dnschallenge=true
      - --certificatesresolvers.cloudflare.acme.email=$CF_API_EMAIL
      - --certificatesresolvers.cloudflare.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
      - --certificatesresolvers.cloudflare.acme.storage=acme.json   
      - --certificatesresolvers.cloudflare.acme.dnschallenge.provider=cloudflare

    ports:
      - 80:80
      - 443:443
      - 8888:8888

    environment:
      - CF_API_EMAIL=$CF_API_EMAIL
      - CF_DNS_API_TOKEN=$CF_DNS_API_TOKEN
      - TZ=$TZ
    
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./appdata/traefik/acme/acme.json:/acme.json    
      - ./appdata/traefik/:/etc/traefik/log/
    labels:
      traefik.enable: true
      traefik.http.routers.traefik.rule: Host(`traefik.$LANDOMAIN`)
      traefik.http.routers.traefik.entrypoints: websecure
      traefik.http.routers.traefik.service: api@internal
      traefik.http.routers.traefik.middlewares: auth
      
      traefik.http.middlewares.auth.basicauth.users: $DASHBOARD_USER

So when I got to traefik.lan.domain.io I get this message about an unsecure website accepts thing, when accepts that exception I do get to the dashboard. Under HTTP it says that the domain has an certificate. The acme.json file is populated, if I check the certificate before accepting the connection I do see it has an certificate to the url.
So why do I get a question about accepting an unsecure connection?