-
Type:
Task
-
Resolution: Works as Designed
-
Priority:
Critical - P2
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
When I try to connect the mongoDB using the below URI through our internal services
URI := mongodb://user:pass@hostname:27017/db?w=majority //here i get the tls config using our utilities and pass it back here clientOpts := options.Client().ApplyURI(URI).SetTLSConfig(&tlsConfig) client, err = mongo.Connect(ctx, clientOpts) if err != nil { return nil, err }
I get the below error
connection() error occurred during connection handshake: auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-256": (AuthenticationFailed) Authentication failed.
But am able to access the same URI and connect to DB for our external port that works fine ., Not sure if i'm missing something here ,
In our old mongo global sign mgo driver we used to use something like below
session, err := mgo.DialWithInfo(mongoDBDialInfo) ,
where we set the DialServer info using tls.Dial("tcp",addr.String(), &tlsConfig) and pass it to the DialInfo
currently we are in the process of migrating our code from mgo driver to go official mongo-driver .
Can anyone help me with this ?