-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix enable_tls issue #988
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
Fix enable_tls issue #988
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -228,19 +228,7 @@ def test_kwargs_from_env_tls_verify_false_no_cert(self): | |
DOCKER_TLS_VERIFY='') | ||
os.environ.pop('DOCKER_CERT_PATH', None) | ||
kwargs = kwargs_from_env(assert_hostname=True) | ||
self.assertEqual('https://192.168.59.103:2376', kwargs['base_url']) | ||
self.assertTrue('ca.pem' in kwargs['tls'].ca_cert) | ||
self.assertTrue('cert.pem' in kwargs['tls'].cert[0]) | ||
self.assertTrue('key.pem' in kwargs['tls'].cert[1]) | ||
self.assertEqual(True, kwargs['tls'].assert_hostname) | ||
self.assertEqual(False, kwargs['tls'].verify) | ||
try: | ||
client = Client(**kwargs) | ||
self.assertEqual(kwargs['base_url'], client.base_url) | ||
self.assertEqual(kwargs['tls'].cert, client.cert) | ||
self.assertFalse(kwargs['tls'].verify) | ||
except TypeError as e: | ||
self.fail(e) | ||
self.assertEqual('tcp://192.168.59.103:2376', kwargs['base_url']) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From this test change it's not clear to me what the expected behaviour is supposed to be. It seems like we're reverting part of the recent change, is that right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. I tested that case locally with the docker CLI, and setting DOCKER_TLS_VERIFY to empty string and DOCKER_HOST to a TCP address let me connect to an unsecured daemon, so I believe this change is correct. |
||
|
||
def test_kwargs_from_env_no_cert_path(self): | ||
try: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in the case where
DOCKER_TLS_VERIFY=
we're changing from tls being enabled by default, to tls being disabled by default?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - this in accordance with what people reported in #984.