aboutsummaryrefslogtreecommitdiff
path: root/middleware/pkg/tls/tls_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'middleware/pkg/tls/tls_test.go')
-rw-r--r--middleware/pkg/tls/tls_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/middleware/pkg/tls/tls_test.go b/middleware/pkg/tls/tls_test.go
index 6d0cb7372..408469045 100644
--- a/middleware/pkg/tls/tls_test.go
+++ b/middleware/pkg/tls/tls_test.go
@@ -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")
+ }
+}