|
|
@@ -95,12 +95,12 @@ func TestNewTransportTLSInfo(t *testing.T) {
|
|
|
KeyFile: tlsinfo.KeyFile,
|
|
|
},
|
|
|
{
|
|
|
- CertFile: tlsinfo.CertFile,
|
|
|
- KeyFile: tlsinfo.KeyFile,
|
|
|
- CAFile: tlsinfo.CAFile,
|
|
|
+ CertFile: tlsinfo.CertFile,
|
|
|
+ KeyFile: tlsinfo.KeyFile,
|
|
|
+ TrustedCAFile: tlsinfo.TrustedCAFile,
|
|
|
},
|
|
|
{
|
|
|
- CAFile: tlsinfo.CAFile,
|
|
|
+ TrustedCAFile: tlsinfo.TrustedCAFile,
|
|
|
},
|
|
|
}
|
|
|
|
|
|
@@ -136,13 +136,13 @@ func TestTLSInfoEmpty(t *testing.T) {
|
|
|
want bool
|
|
|
}{
|
|
|
{TLSInfo{}, true},
|
|
|
- {TLSInfo{CAFile: "baz"}, true},
|
|
|
+ {TLSInfo{TrustedCAFile: "baz"}, true},
|
|
|
{TLSInfo{CertFile: "foo"}, false},
|
|
|
{TLSInfo{KeyFile: "bar"}, false},
|
|
|
{TLSInfo{CertFile: "foo", KeyFile: "bar"}, false},
|
|
|
- {TLSInfo{CertFile: "foo", CAFile: "baz"}, false},
|
|
|
- {TLSInfo{KeyFile: "bar", CAFile: "baz"}, false},
|
|
|
- {TLSInfo{CertFile: "foo", KeyFile: "bar", CAFile: "baz"}, false},
|
|
|
+ {TLSInfo{CertFile: "foo", TrustedCAFile: "baz"}, false},
|
|
|
+ {TLSInfo{KeyFile: "bar", TrustedCAFile: "baz"}, false},
|
|
|
+ {TLSInfo{CertFile: "foo", KeyFile: "bar", TrustedCAFile: "baz"}, false},
|
|
|
}
|
|
|
|
|
|
for i, tt := range tests {
|
|
|
@@ -163,8 +163,8 @@ func TestTLSInfoMissingFields(t *testing.T) {
|
|
|
tests := []TLSInfo{
|
|
|
{CertFile: tlsinfo.CertFile},
|
|
|
{KeyFile: tlsinfo.KeyFile},
|
|
|
- {CertFile: tlsinfo.CertFile, CAFile: tlsinfo.CAFile},
|
|
|
- {KeyFile: tlsinfo.KeyFile, CAFile: tlsinfo.CAFile},
|
|
|
+ {CertFile: tlsinfo.CertFile, TrustedCAFile: tlsinfo.TrustedCAFile},
|
|
|
+ {KeyFile: tlsinfo.KeyFile, TrustedCAFile: tlsinfo.TrustedCAFile},
|
|
|
}
|
|
|
|
|
|
for i, info := range tests {
|
|
|
@@ -215,7 +215,7 @@ func TestTLSInfoConfigFuncs(t *testing.T) {
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- info: TLSInfo{CertFile: tlsinfo.CertFile, KeyFile: tlsinfo.KeyFile, CAFile: tlsinfo.CertFile},
|
|
|
+ info: TLSInfo{CertFile: tlsinfo.CertFile, KeyFile: tlsinfo.KeyFile, TrustedCAFile: tlsinfo.CertFile},
|
|
|
clientAuth: tls.RequireAndVerifyClientCert,
|
|
|
wantCAs: true,
|
|
|
},
|