Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-1397

Unable to connect to mongodb without port number

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.5.1
    • Component/s: Connection Mgmt
    • Labels:
    • Environment:
      Any as far as I know
    • 1

      It is not possible to connect to a Mongo Client without using a port number with pymongo. When using the MongoClient command like c = MongoClient('user:pass@mongo.example.com'), regardless if you do or do not define the port parameter as None, it will always append :27017.
      The use case is as follows, to ensure a secure SSL connection I used Apcache's Reverse Pass Proxy to connect the mongo db port to a subdomain on my server. In this case, no port number is required and I could just directly connect to mongo.example.com, however, pymongo does not allow me to connect to this address. It forces the use of a port number, which isn't applicable in my case.
      I'm using pymongo to keep track of my experiments for my graduation, and I would love to be able to use it in this way. Is there a possibility to fix this. A solution could be to have the port parameter be 27017 by default instead of None, and when it is set to None, no port number is used. Or being able to pass False to the port parameter.

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            sakoarts Sako
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: