diff options
Diffstat (limited to 'src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/mongodb/mongo-tools-common/testutil/ssl_integration.go')
-rw-r--r-- | src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/mongodb/mongo-tools-common/testutil/ssl_integration.go | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/mongodb/mongo-tools-common/testutil/ssl_integration.go b/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/mongodb/mongo-tools-common/testutil/ssl_integration.go deleted file mode 100644 index f5e48631d3c..00000000000 --- a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/mongodb/mongo-tools-common/testutil/ssl_integration.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (C) MongoDB, Inc. 2014-present. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. You may obtain -// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - -package testutil - -import ( - commonOpts "github.com/mongodb/mongo-tools-common/options" - "github.com/mongodb/mongo-tools-common/testtype" - "runtime" - "strings" -) - -func GetSSLArgs() []string { - sslOpts := GetSSLOptions() - if sslOpts.UseSSL { - return []string{ - "--ssl", - "--sslCAFile", sslOpts.SSLCAFile, - "--sslPEMKeyFile", sslOpts.SSLPEMKeyFile, - } - } - return nil -} - -func GetSSLOptions() commonOpts.SSL { - // Get current filename and location - _, filename, _, _ := runtime.Caller(0) - // Get the path to containing folder - foldername := filename[0:strings.LastIndex(filename, "/")] - caFile := foldername + "/../db/testdata/ca.pem" - serverFile := foldername + "/../db/testdata/server.pem" - if testtype.HasTestType(testtype.SSLTestType) { - return commonOpts.SSL{ - UseSSL: true, - SSLCAFile: caFile, - SSLPEMKeyFile: serverFile, - } - } - - return commonOpts.SSL{ - UseSSL: false, - } -} |