SSL certificate installation issue

Hello,
I need help to understant why I can't install my ssl certificate.

Where should I put the ssl certificate using this config


defaultEntryPoints = ["http", "https"]

[entryPoints]
    [entryPoints.http]
        address = ":80"
	[entryPoints.http.redirect]
            entryPoint = "https"



    [entryPoints.https]
        address = ":443"
        [entryPoints.https.tls]
            [[entryPoints.https.tls.certificates]]
                certFile = "/ssl/mydomainname.com_ssl_certificate.cer"
                keyFile = "/ssl/mydomainname.com_private_key.key"

        [docker]
            endpoint = "unix:///var/run/docker.sock"
            domain = "docker.localhost"
            watch = true
            exposedbydefault = false

my certificate *.cer and *.key are both in "ssl" directory witch is in the same directory as the docker-compose.yml file.

I get this error with command docker compose logs:
"level=error msg="Unable to add a certificate to the entryPoint "https" : unable to generate TLS certificate : tls: failed to find any PEM data in certificate input"

Hope someone can help me.

You need to load custom TLS certs with the tls section in a dynamic config file (doc).

Load the dynamic config file with providers.file in static config (doc).

Enable TLS on entrypoint/router using tls: {} (yaml) or .tls=true (command/label).

Note that Docker is not supposed to be in entrypoints, that looks pretty wrong. Check simple Traefik example and other example folders.

Hi @bluepuma77

Thank you for you reply.

I'm sorry I don't understand what you mean exactly.
The file I'm showing is used with traefik v1.7. and is working fine on another server.
Where should docker appear if not in entrypoints ?

" You need to load custom TLS certs with the tls section in a dynamic config file " ??? ==> What's the tls section. Is it a separate/standalone section ?
" Enable TLS on entrypoint /router using tls: {} (yaml) or .tls=true (command/label). " => how exactly. Is this two distinct structure ? One if file is yaml and the other is file is toml ?
" Load the dynamic config file with providers.file in static config " => What's a providers.file ? .file (could be .yaml or .toml ? )

I think It will be better If you could write a simple example with everything you've mentioned.

Thank you

You seriously still run Traefik v1.7, for which active support ended Dec 31, 2021?

1 Like

Yes. Actually it's not my server. I helping someone. Ok I will try an upgrade. Hope it will be easier.