Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2609

Error Connecting to MongoDB using go driver from our internal services

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Works as Designed
    • Icon: Critical - P2 Critical - P2
    • None
    • None
    • None
    • None

    Description

      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 ? 

       

      Attachments

        Activity

          People

            matt.dale@mongodb.com Matt Dale
            karthickcseapitam@gmail.com karthick d
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: