mirror of
https://github.com/coredns/coredns.git
synced 2025-10-30 09:43:17 -04:00
middleware/etcd: move NewHTTPTransport to pkg/tls (#769)
This commit is contained in:
@@ -79,3 +79,23 @@ func TestNewTLSConfigFromArgs(t *testing.T) {
|
||||
t.Error("Certificateis should have a single entry when three args passed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewHTTPSTransport(t *testing.T) {
|
||||
rmFunc, _, _, ca := getPEMFiles(t)
|
||||
defer rmFunc()
|
||||
|
||||
cc, err := NewTLSClientConfig(ca)
|
||||
if err != nil {
|
||||
t.Errorf("Failed to create TLSConfig: %s", err)
|
||||
}
|
||||
|
||||
tr := NewHTTPSTransport(cc)
|
||||
if tr == nil {
|
||||
t.Errorf("Failed to create https transport with cc")
|
||||
}
|
||||
|
||||
tr = NewHTTPSTransport(nil)
|
||||
if tr == nil {
|
||||
t.Errorf("Failed to create https transport without cc")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user