diff --git a/README.md b/README.md index 5b9037cf..294ac090 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,13 @@ Artie Reader reads from databases to perform historical snapshots and also reads ## Supports: -| | Snapshot | Streaming | -|------------|----------|-----------------| -| DynamoDB | ✅ | ✅ | -| MongoDB | ✅ | 🚧 Experimental | -| MySQL | ✅ | ❌ | -| PostgreSQL | ✅ | ❌ | -| SQL Server | ✅ | ❌ | +| | Snapshot | Streaming | +|------------|----------|-----------| +| DynamoDB | ✅ | ✅ | +| MongoDB | ✅ | ✅ | +| MySQL | ✅ | ❌ | +| PostgreSQL | ✅ | ❌ | +| SQL Server | ✅ | ❌ | ## Running diff --git a/config/mongodb.go b/config/mongodb.go index eb44b57b..eda344a5 100644 --- a/config/mongodb.go +++ b/config/mongodb.go @@ -33,6 +33,7 @@ type MongoDB struct { Database string `yaml:"database"` Collections []Collection `yaml:"collections"` StreamingSettings StreamingSettings `yaml:"streamingSettings,omitempty"` + DisableTLS bool `yaml:"disableTLS"` } type Collection struct { diff --git a/sources/mongo/mongo.go b/sources/mongo/mongo.go index 68dd2f96..6cd6f581 100644 --- a/sources/mongo/mongo.go +++ b/sources/mongo/mongo.go @@ -26,7 +26,11 @@ func Load(cfg config.MongoDB) (*Source, bool, error) { Password: cfg.Password, } - opts := options.Client().ApplyURI(cfg.Host).SetAuth(creds).SetTLSConfig(&tls.Config{}) + opts := options.Client().ApplyURI(cfg.Host).SetAuth(creds) + if !cfg.DisableTLS { + opts = opts.SetTLSConfig(&tls.Config{}) + } + ctx := context.Background() client, err := mongo.Connect(ctx, opts) if err != nil {