-
Notifications
You must be signed in to change notification settings - Fork 2k
Problems using a custom boot2docker ISO hosted on an internal HTTPS site with self-signed cert #491
Comments
Some clarification - this actually doesn't work with boot2docker-cli either. I had built the ISO locally at first, so it never had to actually download it. So I guess this is a more general issue. Anyone had any experience with this? |
I'm not quite sure how this would work. I guess it all depends on how "net/http" reads CA certs from the system, I'd assume it'll use the keychain on OS X and the CA store on Linux... |
Yeah, I did some |
We are experiencing this problem as well. It seems to me this is caused by the cross-compilation on linux. If I |
Ok thanks. I'll try the same for me and see if we can get a fix. On Tuesday, February 10, 2015, Fabian Ruff notifications@github.com wrote:
|
Apparently this problem is pretty old news. See boot2docker/boot2docker-cli#13 or moby/moby#3683 for example. Looking at go's source there are two different ways for reading the root certificates for darwin depending on whether cgo is enabled or not:
Looking at the Commit golang/go@4f23481 mentions that there are some differences:
When building natively on OS X this is a non issue but when cross-compiling for darwin it seems to be the CA handling is partly broken. There just seems to be no easy way of making go pick up user supplied trusted root CAs from the Keychain. |
Should we vendor a set of root CA certs like Swarm does? These could be updated periodically. |
@ehazlett: how would that solve this issue? I need to add CA certs that should never be out in the wild... |
@hairyhenderson sorry i was thinking of a different CA issue. perhaps allowing the ability to pass a root CA cert for http or something. Not sure, just trying to throw out some ideas :) |
That's probably the only way |
From @databus23 's comments, it seems like this has to do with golang's cross-compilation on Linux... Maybe a fix would be to compile the OS X binary on OS X instead? I'll admit to having close-to-zero clue about golang, or how docker-machine gets built, so maybe it's not feasible... |
@hairyhenderson Would be worth a test. Would you mind trying this build: https://public.evanhazlett.com/docker-machine/test/docker-machine-f9278b99-darwin-amd64 Built using |
@ehazlett d'oh. Same error as before. |
hmm ok |
Building natively on OS X definitely makes the problem go away. I tested it before and I just tried the linked binary above. It works for me. @ehazlett I don't like the idea that the user has to specifically pass in the certificate. Ideally it should work with all trusted certificates from the keychain as it does when building natively. I see three ways to solve this issue:
I think 1. is the cleanest and most straight forward but its hard to automate and probably requires manual building for the foreseeable future. 2. adds some requirements for running machine: homebrew has to be installed and when installing machine brew also needs to pull down the go package to build the thing. 3. is the most fiddly but could provide a working binary with the current build workflow via docker. I added gonative to the docker-machine |
@databus23 - I have my CAs in the System Keychain as well - i.e. When I have a bit more time (probably not until Sunday or Monday evening, unfortunately), I can try to compile natively myself and see if that works differently... |
This is an odd bug, we should trace it through and report it. |
@databus23 completely agree with using system certs. |
@sthulb I believe this is a bug that can't be fixed easily. There just seems to be no way of getting a list of all trusted certificates without interfacing with the Security Framework c library provided by Apple. The command line utility |
I guess we'll just have to make OS X builds on OS X from now on :) |
Wow, very sorry to hear about this @hairyhenderson and @databus23. Thank you for being so diligent with assessment of the issue. I definitely want to help you get a solution to this. I'm very against changing the default build process to native. So this is what I propose to mitigate the issue (short-term):
How does that sound to everyone? @hairyhenderson @databus23 which sounds best to you? |
I think a brew recipe is the best short term solution for OSX from the user perspective. The only hassle is that this also needs to be updated/published for every new release otherwise users who need custom certificates will be stuck on older versions. @nathanleclaire I'm not sure this problem exists for cross compiled windows binaries. |
@nathanleclaire I agree that changing the build progress is not a good idea. Its really slick the way it is. That being said I still think that the solution proposed in the linked blog post would be better solution in the long run. It still allows for cross compiling with gox in a container but without the limitations cross-compiling usually brings regarding the go stdlib. In general you guys should be aware that shipping cross-compiled darwin binaries that do anything with https might blow up for users which use certificates Apple didn't put in the SystemRoots Keychain. |
@nathanleclaire - if there's a way to add a cert to machine's trusted cert list, would it be possible to get machine to add |
@hairyhenderson To my knowledge this is not possible without negative security implications. Using |
@databus23 ah - I see... sounds like we need some other tool that's aware of trust settings. |
@hairyhenderson I think the options outlined in my above post are better solutions then trying to reimplemented the certificate trust setting evaluation as done by the Security Framework of OSX. Specifically option 3. allows to still cross-compile using a docker container while having the exact same code path for x509 certificate handling as when compiling natively. |
@databus23 I was looking into this recently and I don't believe the I think the only way to programmatically get a list of certificates is to go to the low-level |
@md5 It sure does. This is how the go stdlib itself fetches the certificates for the |
@databus23 Thanks. Looks like the command is actually I realize now that I was looking into enumerating passwords, not certificates. |
@databus23 I like the idea of using |
@ehazlett I might be misunderstanding this, but I think this statement means cross-compiling with gonative directly on windows is not tested. In docker-machine's case the container build flow ensures we always compile on linux. The author of gonative writes in the accompanying blog post:
|
@databus23 correct. Ah ok -- perhaps I misunderstood -- I read it as "the cross compiled binary hasn't been tested on Windows". I did see the comment from the blog so I think it's worth it to try. |
@hairyhenderson, is there any solution now to retrieve a custom (corporate) boot2docker.iso from a server with https (and own company certificate)? |
@FraBle Yes, just compile docker-machine natively. |
@databus23, thanks for your super fast reply.
The certificate for out Github is imported in the System Keychain. ps: in terms of dependencies:
|
@FraBle Thats odd. It should work if you have the SAP Global Root CA in your keychain. Are you sure you are invoking the right |
@FraBle What is output of |
|
Yup, looks symlinked to the Homebrew version correctly. |
So this definitely should work. I'm using the same homebrew version against the same internal github enterprise installation. Has to be something with your local setup. |
@databus23, you have mail in your corporate mailbox :) |
@FraBle I'm on CET so i'll look into tomorrow. Cheers |
Wow, this was a blast from the past 😉 -- makes me thankful I'm no longer working for the company I was at when I logged this 😁 Seriously though, it seems we probably need to update some docs somewhere to cover this use-case... |
This issue has nothing to do with homebrew. It's how 'go' reads certificates. Solution is to import your corporate root certificate into SystemRootCertificates.keychain. @databus23 @FraBle Ping me via Lync if you need some inputs. ;) |
So I'm getting this error:
$ VIRTUALBOX_BOOT2DOCKER_URL=https://my-internal-server.mydomain.com/boot2docker.iso $ docker-machine create -d virtualbox --virtualbox-boot2docker-url=$VIRTUALBOX_BOOT2DOCKER_URL dev INFO[0000] Downloading boot2docker.iso from https://my-internal-server.mydomain.com/boot2docker.iso... ERRO[0000] Error creating machine: Get https://my-internal-server.mydomain.com/boot2docker.iso: x509: certificate signed by unknown authority WARN[0000] You will want to check the provider to make sure the machine and associated resources were properly removed. FATA[0000] Error creating machine
I need a custom
boot2docker.iso
because our internal HTTPS all uses an internal corporate Root CA for signing (so, basically self-signed). I had this working fine with boot2docker-cli (see boot2docker/boot2docker#347), but I want to try out docker-machine with the same ISO.I'm on OS X, and I've installed the Root CA certs in such a way that most apps recognize it (browsers, etc...). Is there some special other way to install my certs such that docker-machine will be OK with them?
Thanks!
The text was updated successfully, but these errors were encountered: