Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-101

SSL Error in logs when connecting to replicaset from Node.js

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.4
    • Affects Version/s: None
    • Component/s: None
    • Environment:
      Mongo is running on Linux RHEL 6

      I have a 2 node replica set + 1 arbiter all running on Linux (RHEL 6) using SSL. Replication is working fine however I am seeing some strange errors in the Mongo log file when connecting to the replica set (or even a single node) from Node.js. Despite the log file indicating that the connection has been closed, I am able to run queries on the DB without issue, it's just that the log file is filling up with the messages (about once ever 5 seconds).

      Code:

      var MongoClient = require('mongodb').MongoClient;
      
      MongoClient.connect('mongodb://username:password@server1:1234,server2:1234/dbname?ssl=true&authSource=admin&replicaSet=rs0', function(err, db) {
          if(err) {
          	console.log(err);
          }
          else {
          	console.log('Connected to mongo');
          }
      });
      

      Log:

      Wed Dec  4 07:59:23.044 [conn1450298] ERROR: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol
      Wed Dec  4 07:59:23.044 [conn1450298] SocketException handling request, closing client connection: 9001 socket exception [6]
      

      I don't see the same when connecting from a Java process so I'm assuming that the issue here is in he client code rather than the MongoDB setup.

      Thanks

      Steve

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            stephen.dalby@citi.com Stephen Dalby
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: