building router handler: building TLS config: invalid certificate(s) content

175 Views Asked by At

i am trying to load the tls certificates for one of my traefik routers. the path in the certFile and keyFile is the path to a volume mount on my container that contains the secrets with the certificates inside

here is my router config toml file

[http.routers]
  [http.routers.router1]
    rule = "PathPrefix(`/path1`)"
    middlewares = ["middleware1"]
    service = "service1"
    entryPoints = ["web-secure"]
  [http.routers.router2]
    rule = "PathPrefix(`/path2`)"
    middlewares = ["middleware2"]
    service = "service2"
    entryPoints = ["web-secure"]
  [http.routers.router3]
    rule = "Path(`path3`)"
    middlewares = ["middleware3"]
    service = "service"
    entryPoints = ["web-secure"]

[[tls.certificates]]
  certFile = "/app/pki/etc/webserver_cert.crt"
  keyFile = "/app/pki/etc/webserver_cert.key"

however when i check my logs on openshift, it gives me the following error for all our routers {"entryPointName":"web-secure","level":"error","msg":"building router handler: building TLS config: invalid certificate(s) content","routerName":"router2@file","time":"2023-07-12T02:21:48Z"}

i referenced this documentation to create dynamic tls config within the router, but not sure why it is not registering the certificate https://doc.traefik.io/traefik/migration/v1-to-v2/#tls-configuration-is-now-dynamic-per-router

path in the certFile and keyFile is correct and the certificates are in the right format as well, so im not sure what other potential problems could've caused this error

0

There are 0 best solutions below