Summary
Matcher does not support loading TLS CA certificates for MongoDB connections, which is required for secure connections to AWS DocumentDB.
Current State
Matcher uses direct MongoDB connection without any TLS configuration. This prevents secure connections to managed MongoDB services like AWS DocumentDB that require CA certificate validation.
Proposed Solution
Migrate MongoDB connection to use lib-commons/v4/commons/mongo and add support for MONGO_TLS_CA_CERT env var (base64 encoded PEM):
var tlsCfg *libMongo.TLSConfig
if cfg.MongoTLSCACert != "" {
tlsCfg = &libMongo.TLSConfig{CACertBase64: cfg.MongoTLSCACert}
}
mongoConnection, err := libMongo.NewClient(ctx, libMongo.Config{
URI: mongoSource,
Database: cfg.MongoDBName,
TLS: tlsCfg,
})
This follows the same pattern used for Redis: REDIS_CA_CERT → libRedis.TLSConfig{CACertBase64}
Why
AWS DocumentDB requires TLS with a specific CA certificate. Currently the only workaround is tlsInsecure=true which skips certificate validation - not ideal for production.
Acceptance Criteria
Summary
Matcher does not support loading TLS CA certificates for MongoDB connections, which is required for secure connections to AWS DocumentDB.
Current State
Matcher uses direct MongoDB connection without any TLS configuration. This prevents secure connections to managed MongoDB services like AWS DocumentDB that require CA certificate validation.
Proposed Solution
Migrate MongoDB connection to use
lib-commons/v4/commons/mongoand add support forMONGO_TLS_CA_CERTenv var (base64 encoded PEM):This follows the same pattern used for Redis:
REDIS_CA_CERT→libRedis.TLSConfig{CACertBase64}Why
AWS DocumentDB requires TLS with a specific CA certificate. Currently the only workaround is
tlsInsecure=truewhich skips certificate validation - not ideal for production.Acceptance Criteria
MONGO_TLS_CA_CERTenv var to config struct