-
Notifications
You must be signed in to change notification settings - Fork 126
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
common: correct bad default value for tls_hostname #128
Conversation
`module_utils.docker.common` set `DEFAULT_TLS_HOSTNAME = 'localhost'`. This means that when `tls_hostname` is unset in a playbook, we would simply use `localhost` rather than calling `update_tls_hostname` (which extracts the hostname from the docker URL). This would cause connection failures when TLS certificate verification is enabled because the hostname would not match the certificate. This commit sets `DEFAULT_TLS_HOSTNAME = None` so that we properly extract the hostname from the Docker URL when it is not provided explicitly.
For example, without this patch, the following playbook:
Fails with:
With this PR applied, it works correctly. |
I guess this will break every role and playbook which relies on that the default is |
I don't think this should cause a problem: when using |
While that is true, it could be |
That configuration wouldn't work with the
|
Yes. But this is still a breaking change for this collection, so we cannot merge it. We need to deprecate the current behavior and switch for 2.0.0, but until 2.0.0 we need to keep the current behavior. |
It fixes a real problem, and absent a demonstration to the contrary I don't think it breaks anything. If you can't merge it, I hope that other folks find their way here when they run into the same problem. |
I sketched out a very concrete scenario which this PR breaks. It might not be a common one, but it can potentially exist. |
module_utils.docker.common
setDEFAULT_TLS_HOSTNAME = 'localhost'
.This means that when
tls_hostname
is unset in a playbook, we wouldsimply use
localhost
rather than callingupdate_tls_hostname
(which extracts the hostname from the docker URL).
This would cause connection failures when TLS certificate verification
is enabled because the hostname would not match the certificate.
This commit sets
DEFAULT_TLS_HOSTNAME = None
so that we properlyextract the hostname from the Docker URL when it is not provided
explicitly.