MCPcopy Create free account
hub / github.com/containers/image / TestTlsConfigFromCertPath

Function TestTlsConfigFromCertPath

docker/daemon/client_test.go:54–69  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func 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
71func TestSkipTLSVerifyOnly(t *testing.T) {
72 //testDir := testDir(t)

Callers

nothing calls this directly

Calls 2

testDirFunction · 0.85
tlsConfigFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…