Skip to content

Commit 1382f4b

Browse files
Fixed issue causing tls preferences being ignored
1 parent db75e4a commit 1382f4b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cmd/docStreamer/main.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ func startAction(cmd *cobra.Command, args []string) {
133133
mongoURI := config.Cfg.BuildMongoURI(mongoUser, mongoPass)
134134

135135
logging.PrintStep("Connecting to source DocumentDB...", 0)
136-
tlsConfig := &tls.Config{InsecureSkipVerify: config.Cfg.DocDB.TlsAllowInvalidHostnames}
137-
clientOpts := options.Client().ApplyURI(docdbURI).SetTLSConfig(tlsConfig)
136+
clientOpts := options.Client().ApplyURI(docdbURI)
138137
sourceClient, err := mongo.Connect(clientOpts)
139138
if err != nil {
140139
logging.PrintError(fmt.Sprintf("Failed to create source client: %v", err), 0)
@@ -149,8 +148,7 @@ func startAction(cmd *cobra.Command, args []string) {
149148
}
150149

151150
logging.PrintStep("Connecting to target MongoDB...", 0)
152-
mongoTlsConfig := &tls.Config{InsecureSkipVerify: config.Cfg.Mongo.TlsAllowInvalidHostnames}
153-
mongoClientOpts := options.Client().ApplyURI(mongoURI).SetTLSConfig(mongoTlsConfig)
151+
mongoClientOpts := options.Client().ApplyURI(mongoURI)
154152
targetClient, err := mongo.Connect(mongoClientOpts)
155153
if err != nil {
156154
logging.PrintError(fmt.Sprintf("Failed to create target client: %v", err), 0)

0 commit comments

Comments
 (0)