Commit 4cd132e
committed
fix: Enable registries with self-signed certificates
This change enables Skaffold to push to container image registries that use
self-signed or other untrusted certificates, when Skaffold runs on macOS or
Windows. It also removes the need for the `SSL_CERT_FILE` environment
variable workaround on Linux.
Prior to this fix, Skaffold would fail to retrieve the digest from the
registry after the image was built, even if the registry was configured as an
insecure registry in Skaffold configuration:
```
getting image: Get "https://localhost:8443/v2/": tls: failed to verify certificate: x509: certificate signed by unknown authority; GET http://localhost:8443/v2/: unexpected status code 400 Bad Request: Client sent an HTTP request to an HTTPS server.
```
On Linux environments only, a possible workaround was to set the
`SSL_CERT_FILE` environment variable. However, this workaround cannot be used
on macOS or Windows.
This change updates `getRemoteIndex()` and `getRemoteImage()` in
`pkg/skaffold/docker/remote.go`, adding the `InsecureSkipVerify` TLS config
field to the transport if the registry from the image name matches one of
the insecure registries configured in Skaffold.
Fixes: GoogleContainerTools#3039 GoogleContainerTools#3116
Related: google/go-containerregistry#15591 parent c280097 commit 4cd132e
1 file changed
+21
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
126 | 131 | | |
127 | 132 | | |
128 | 133 | | |
| |||
136 | 141 | | |
137 | 142 | | |
138 | 143 | | |
139 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
140 | 151 | | |
141 | 152 | | |
142 | 153 | | |
143 | 154 | | |
144 | 155 | | |
145 | 156 | | |
146 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
147 | 167 | | |
148 | 168 | | |
149 | 169 | | |
| |||
0 commit comments