-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support for self signed certificates #543
Comments
@Hi-Fi , thanks for reporting this issue! We will investigate and see what the best solution here is to support self-signed certificates. |
We should probably have the Jib experience for self-signed certificates be similar to Docker's, as outlined in https://docs.docker.com/registry/insecure/#use-self-signed-certificates - and possibly using Docker's certs if available (from |
Workaround: use http://keystore-explorer.org to add self signed cert to java |
I think that relying on Docker certs is not necessarily the good thing, as at least our use case is to use JIB on the env that are not so easy to make to build docker containers (e.g. Jenkins slaves running on Openhift and developer computers with Windows without admin rights). So best would be some maven configuration parameter, that goes all the way down to used httpClient and ignores the incorrect and also insecure certificates (e.g. SHA-1 using). @velo That seems to work (tried that yesterday with keytool and it wasn't working for some reason). This helps checking of things more, but still requires that custom cacerts injection to slave. Thank you for that tool, it's nicer to use than CLI one. |
@coollog could you point me to the right |
@velo I'd recommend writing a new page ( |
Instructions doc for self-signed certificates is merged! Thanks @velo and other contributors to the PR #618 |
Is it so, that there's not going to be any Maven side configuration for trusting the self-signed certificates? Documentation is OK, when user really has access to cacerts, but if e.g. builds are running on Jenkins (or Jenkins slaves) without access to host itself, only way to make things work with self signed certs is some Maven configuration (or keeping keystore within each repo and injecting that at the start). |
You should be able to set the |
Ah, yeah, this will be nice to document too, along with |
Will do. |
Description of the issue:
When (internal) Docker registry is using self signed certificates (or certificates signed with corporation's own root certificate, that's not trusted by Java), jib tries immediately http-connection (according https://github.com/GoogleContainerTools/jib/blob/master/jib-core/src/main/java/com/google/cloud/tools/jib/registry/RegistryEndpointCaller.java#L219), that's not available in registry.
Current implementation throws error:
Expected behavior:
allowInsecureRegistries
-parameter should allow also https connections with self signed certificates, and not directly drop to http.Steps to reproduce:
mvn compile jib:build with configuration set to point to registry using self signed certificates.
Environment:
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T22:39:06+03:00)
Java version: 1.8.0_131, vendor: Oracle Corporation
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
jib-maven-plugin
Configuration:Log output:
Additional Information:
The actual error causing change to http is:
The text was updated successfully, but these errors were encountered: