-
Notifications
You must be signed in to change notification settings - Fork 691
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
Puller not working with (custom) system certs #273
Comments
Trying to fix this in google/containerregistry#50. |
This fixed the error for me: sudo pip install httplib2.system-ca-certs-locater |
I'm still investigating and trying to wrap my head around everything, but I believe we're experiencing issues (CERTIFICATE_VERIFY_FAILED) connecting to private registry secured by a certificate signed by a real root CA (Comodo) as well, so this issue may not be limited to custom certs. My current theory is that the root CA that signed our cert isn't bundled with httplib2, way down in the depths of containerregistry.
Will report back with more info as I find it. Update: Ultimately, I think our issue is the same as described above, even though it's not a custom cert -- we have a cert signed by a root CA that isn't included in the cacerts.txt bundled with httplib2. We're having issues with both |
We're having the same problem with our registry with custom certs. That's our solution:
|
@sbueringer thanks for the suggestion. The I'm curious how folks in this thread feel about the proposal in #539? (assuming google/containerregistry#89 is merged first) |
Yes I thought the same as I saw the code at the pypy page, but the installed code makes a lot more sense :). |
Hi everyone, |
any update on this? |
it's implemented, but we have not updated the docs yet. You want to try it out? you need to import docker_toolchain_configure as here: https://github.com/bazelbuild/rules_docker/blob/master/testing/custom_toolchain_auth/WORKSPACE#L32. Note the client_config should point to the absolute path where the config is located (in the example we replace the value of client_config in the e2e tests here: https://github.com/bazelbuild/rules_docker/blob/master/testing/e2e.sh#L418. |
For now, I fixed my problem by building a custom |
We added some documentation on how to configure the docker toolchain rule to use custom authentication credentials specified via a docker client config.json in #686 You can specify a custom config.json when configuring the docker toolchain rule that will be used by every container_push rule automatically. container_pull requires a little extra work and our updated docs specifies what that is. Note: All this does is make containerregistry load the config.json specified in the toolchain configuration. It's up to containerregistry to read what's in that file and interpret it appropriately. Docker's official documentation on the client configuration file is at https://docs.docker.com/engine/reference/commandline/cli/#configuration-files |
@smukherj1 I get that now it's possible to allow custom authentication credentials. But how can this be used to solve the problems with the certificates? |
We had hoped specifying a custom client config would result in being able to specify a custom certificate using the instructions here. However, looking at the python containerregistry library's implementation, it doesn't look like it has the ability to load custom certifications specified in the docker client config directory. The python containerregistry uses the python http2 library to load certificates and using the environment variable seems to be the only way to make it use a custom certificate from rules_docker. We are currently in the process of creating new versions of the container_pull & container_push rules that use the go-containerregistry library. Based on a cursory look, I'm not seeing any ability to use custom certificates there. It's possible that after rules docker completely switches to go-containerregistry, the environment variable method mentioned earlier in this issue will stop working. go-containerregistry might need to be modified to support using custom certificates by doing something like the accepted answer here. |
@smukherj1 Funny you should mention go-containerregistry. I looked into it for working with kaniko (which in turn uses go-containerregistry). What is mostly used there is to (selectively) disable cert validation. |
@abergmeier by the |
This solved our issue. |
This appears to be working for me now that rules_docker is using a golang based puller. (without any workarounds) |
Great! Let's close this then and if anyone experiences any other issues let me know to reopen. |
We have custom certs at my company. These are installed in
/usr/local/share/ca-certificates
and work fine with Browsers and most tools (on Ubuntu 16.04.3).Sadly puller is the exception. It fails with:
Is there any way of telling that to use the system certificates?
If not, where does puller/httplib2 store the certificates?
The text was updated successfully, but these errors were encountered: