I’m having this error while trying to connect to a mongodb with the Use DNS SRV when connecting option selected.
This is the (masked) host address:
mongodb+srv://USERNAME:PASSWORD@ADDRESS.mongodb.net/test?retryWrites=true&w=majority
as you can see there is no port in the host address.
I can connect via pymongo from my laptop