-
Notifications
You must be signed in to change notification settings - Fork 563
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
Unable to connect with TLS #173
Comments
My |
I got further along and hit a different problem. I changed my docker host endpoint to It looks like the HTTP client is not finding |
Checking the port number feels like a hack. Looking at how docker/docker is doing it, perhaps a good approach would be to check if |
Still, the port number thing should be pretty safe. |
Now that I've had a closer look at #169, I think that having separate methods is the right approach. However, I think it might be good for |
See discussion in fsouza/go-dockerclient#169 and fsouza/go-dockerclient#173
Agreed that guessing based on port seems like a hack. What if I'm inclined to agree that different methods is the best way to handle things - will maintain backwards compatibility / avoid unexpected behavior |
No, it's not a hack. 2375 is the port reserved for non-secure traffic on Docker (docker), and 2376 is for TLS-based traffic (docker-s). It is as safe as assuming that 80 is HTTP and 443 is HTTPS. It is not a |
Understood. Sorry if I've offended you by calling your proposal a hack. |
I'm going to close this since #169 is tracking the fix. |
No problem at all, you haven't offended me! :) Thanks for contributing to the discussion and the project! |
Cool. Perhaps the next thing to get merged will be this |
Seeing that you just merged the TLS changes, I rebased this: https://github.com/md5/go-dockerclient/compare/new-client-from-env |
I can add docs and tests if you're interested in a PR. |
Hi @md5, are these environment variables used elsewhere? Do they come from boot2docker? At first, I dislike the idea of handling environment variables, but I'd like to make sure I fully understand the use case. Thank you again! |
They're the same ones used by |
Workarounds courtesy of fsouza/go-dockerclient#173. They can likely be removed after better support for TLS docker connections is added to go-dockerclient.
+1 ... @md5's |
👍 |
I attempted to use the
HTTPClient
field to configure TLS support, but was unsuccessful. I get the following error:I believe the problem is here: https://github.com/fsouza/go-dockerclient/blob/master/client.go#L521-L523
Even though I'm setting a
Transport
on myHTTPClient
, it's still trying to use HTTP instead ofHTTPS
because it doesn't know in those lines that my "tcp" connection actually needs to be HTTPS.My code is here: https://github.com/md5/docker-gen/compare/tls-support
The text was updated successfully, but these errors were encountered: