| 52 | } |
| 53 | |
| 54 | func TestTlsConfigFromCertPath(t *testing.T) { |
| 55 | testDir := testDir(t) |
| 56 | |
| 57 | ctx := &types.SystemContext{ |
| 58 | DockerDaemonCertPath: filepath.Join(testDir, "testdata", "certs"), |
| 59 | DockerDaemonInsecureSkipTLSVerify: true, |
| 60 | } |
| 61 | |
| 62 | httpClient, err := tlsConfig(ctx) |
| 63 | |
| 64 | assert.NoError(t, err, "There should be no error creating the HTTP client") |
| 65 | |
| 66 | tlsConfig := httpClient.Transport.(*http.Transport).TLSClientConfig |
| 67 | assert.True(t, tlsConfig.InsecureSkipVerify, "TLS verification should be skipped") |
| 68 | assert.Len(t, tlsConfig.Certificates, 1, "There should be one certificate") |
| 69 | } |
| 70 | |
| 71 | func TestSkipTLSVerifyOnly(t *testing.T) { |
| 72 | //testDir := testDir(t) |