Set up traefik as reverse proxy to vaultwarden container (using a ROCKET_TLS server internally listening on port 80 but expecting HTTPS)
Set up vaultwarden to use the internal SSL service with a letsencrypt certificate
Configured traefik to use an own letsencrypt certificate for the frontend and forward to port 80 of vaultwarden with - "traefik.http.services.vaultwarden.loadbalancer.server.scheme=https"
BadCertificate error on service-side (vaultwarden logs):
[rocket_http::tls::listener][WARN] tls handshake with X.X.X.X:59756 failed: received fatal alert: BadCertificate
Seems to be an issue with how traefik handles vaultwarden's certificate as other clients work fine when directly connecting to vaultwardens port 80 via the docker network.
"--serverstransport.rootcas=/vault-ca.crt"
does not seem to help even though with this file including the rootCA and certificate of the service expectation would be that the server's certificate is accepted without further checking (which is not possible since traefik addresses the service via its IP and not its domain.
Can I apply this option only to this single service (e.g. in the service's docker -compose) or does it need to be configured globally in the traefik docker-compose?
If yes, how does the label line look like in this case?
And alternatively: Why isn't it possible to just add the service's certificate to the rootCAs so that it is always accepted but still if someone tinkered with the certificate traefik would notice and not forward the request - as opposed to the insecureSkipVerify-solution.
Yes, you can create a serversTransport in dynamic config and assign it to the service (doc).
The error indicates that the target is verified against the cert. Traefik will connect via IP and the IP is not in the cert. Usually you would connect via domain and it’s included in the cert.
Thanks. This is really not that intuitive. Still does not work on my side. Traefik gives me in the log: 2024-11-14T14:01:26Z ERR error="servers transport not found SSLtransport@docker" entryPointName=websecure routerName=vaultwarden@docker