Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker TLS certificate not presented to server #4061

Closed
2 tasks done
sevmonster opened this issue Nov 19, 2023 · 2 comments
Closed
2 tasks done

Docker TLS certificate not presented to server #4061

sevmonster opened this issue Nov 19, 2023 · 2 comments
Labels

Comments

@sevmonster
Copy link

⚠️ Please verify that this bug has NOT been raised before.

  • I checked and didn't find similar issue

🛡️ Security Policy

Description

I added ca.pem, cert.pem, and key.pem to the docker-tls directory, and added the self-signed CA to Node with NODE_EXTRA_CA_CERTS=/app/data/docker-tls/ca.pem in my docker-compose.yml, but I get the error http: TLS handshake error from 1.2.3.4:1234: tls: client didn't provide a certificate in Docker logs, and Uptime Kuma is unable to connect.

I am able to manually connect to the daemon with curl:

sudo sh -c "cd data/docker-tls; curl 'https://1.2.3.4:2376/containers/json?all=true' --cert cert.pem --cacert ca.pem --key key.pem"

{"docker json": "output"}

And for good measure I am able to do so from the host as well:

sudo curl 'https://1.2.3.4:2376/containers/json?all=true' -k --cert cert.pem --cacert ca-public.pem --key key.pem

{"docker json": "output"}

👟 Reproduction steps

  1. Generate self-signed host and client certs
  2. Enable tls in Docker daemon and provide host keys/CA
  3. Install client keys/CA to docker-tls directory in Uptime Kuma data directory
  4. Add HTTPS Docker host to Uptime Kuma

👀 Expected behavior

It works

😓 Actual Behavior

It doesn't work

🐻 Uptime-Kuma Version

1.23.6

💻 Operating System and Arch

Alpine Linux edge

🌐 Browser

Chromium 119

🐋 Docker Version

Docker 24.0.7

🟩 NodeJS Version

No response

📝 Relevant log output

No response

@sevmonster sevmonster added the bug Something isn't working label Nov 19, 2023
@chakflying
Copy link
Collaborator

According to #2852 you need to put the certificate files in a subfolder in docker-tls with the FQDN as the folder name. Have you tried doing so?

@louislam louislam added help and removed bug Something isn't working labels Nov 20, 2023
@sevmonster
Copy link
Author

You're right, I missed the dataDir variable. I will update the wiki later since that hasn't been done yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants