• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

428
Views
Traefik y SSL autofirmado

Noob a Traefik y Docker. He preparado un certificado autofirmado usando:

 openssl req -x509 -newkey rsa:4096 -keyout www.example.co.uk.key -out www.example.co.uk.crt-days 365

En mi archivo traefik.toml tengo:

 [entryPoints] [entryPoints.http] address = ":80" [entryPoints.https] address = ":443" [entryPoints.https.tls] [[entryPoints.https.tls.certificates]] certFile = "certs/www.example.co.uk.crt" keyFile = "certs/www.example.co.uk.key"

Sin embargo, esto da como resultado:

 traefik | time="2019-06-17T22:11:17Z" level=debug msg="Serving default cert for request: \"www.example.co.uk\"" traefik | time="2019-06-17T22:11:17Z" level=debug msg="http: TLS handshake error from 172.20.0.1:57770: tls: no certificates configured"

Si omito las definiciones de certificado para que traefik.toml se lea como:

 [entryPoints] [entryPoints.http] address = ":80" [entryPoints.https] address = ":443" [entryPoints.https.tls] # [[entryPoints.https.tls.certificates]] # certFile = "certs/www.example.co.uk.crt" # keyFile = "certs/www.example.co.uk.key"

Obtuve el certificado ficticio proporcionado por Traefik y funciona muy bien, pero solo quiero entender por qué no se usan mis certificados definidos.

En mi docker-compose.yml creo que he montado el volumen correcto:

 volumes: - /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events - ./traefik.toml:/traefik.toml - /var/www/docker/certs:/certs

Y los certificados residen en certs/ en relación con mis archivos docker-compose.ym l y traefik.toml . Los permisos también parecen buenos, ambos propiedad de root: el crt tiene 644 y key tiene 600.

¿Cómo puedo usar un certificado autofirmado en lugar de los valores predeterminados de Traefiks?

about 3 years ago · Santiago Trujillo
1 answers
Answer question

0

Probablemente un desajuste de ruta, particularmente con algunas rutas relativas y otras absolutas. Pruebe lo siguiente en su archivo de redacción (ruta relativa a los certificados locales):

 volumes: - /var/run/docker.sock:/var/run/docker.sock - ./traefik.toml:/traefik.toml - ./certs:/certs

Y luego cambie a una ruta absoluta en el toml (barra inclinada inicial en certificados):

 [entryPoints] [entryPoints.http] address = ":80" [entryPoints.https] address = ":443" [entryPoints.https.tls] [[entryPoints.https.tls.certificates]] certFile = "/certs/www.example.co.uk.crt" keyFile = "/certs/www.example.co.uk.key"
about 3 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error