-
Notifications
You must be signed in to change notification settings - Fork 2k
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
"nomad logs" with TLS broken #2290
Comments
I believe the problem is the advertised http address on the server running the allocation. You're advertising 172.28.128.8 instead of localhost. This should be fixed by adding the advertise directive to your agent config. |
@dbresson Advertising I think there's a bug in our TLS configuration when the client tries to connect to the node running the allocation. @andreynpetrov Is the certificate on 172.28.128.8 (should be a client node) valid for the name Adding |
openssl output: In client config: Maybe I need to advertise hostname and add it to cert? |
@andreynpetrov That would fix it, but that's not how we intend mutual TLS auth in Nomad to work. The intention is that your nodes are more or less ephemeral and so generating new certificates with the proper hostname for every new node is untenable. Instead we intend people to do exactly what you did: use So this is a bug, but you can work around it with |
Good to know. Thank you for clarification. |
Sorry for the misinformation, I was unaware of the oddball way nomad does tls cert verification. |
@dbresson It's something we may be changing in the future to be a bit less oddball while still not requiring unique certificates per-host. |
Same issue appears with
@schmichael asked me to mention it here |
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
Nomad version
v0.5.2
Operating system and Environment details
Ubuntu 16.04 x86_64
root@node-2:~# env | grep NOMAD
NOMAD_CACERT=/etc/pki/tls/certs/ca.pem
NOMAD_CLIENT_CERT=/etc/pki/tls/certs/nomad.pem
NOMAD_CLIENT_KEY=/etc/pki/tls/private/nomad-key.pem
NOMAD_ADDR=https://localhost:4646
Issue
Get error on "nomad logs":
root@node-2:~# nomad logs 8095d822
Error reading file: Get https://172.28.128.8:4646/v1/client/fs/logs/8095d822-b270-bcdc-d7fc-2db37f69d109?follow=false&offset=0&origin=start&task=nginx&type=stdout: x509: cannot validate certificate for 172.28.128.8 because it doesn't contain any IP SANs
But "nomad status" works:
root@node-2:~# nomad status
ID Type Priority Status
test service 50 running
Reproduction steps
Enable TLS and setup env:
export NOMAD_ADDR=https://localhost:4646
export NOMAD_CACERT=/etc/pki/tls/certs/ca.pem
export NOMAD_CLIENT_CERT=/etc/pki/tls/certs/nomad.pem
export NOMAD_CLIENT_KEY=/etc/pki/tls/private/nomad-key.pem
The text was updated successfully, but these errors were encountered: