How to Enable TLS/SSL on Mlab MongoDB

Learn how to encrypt connections to your Mlab MongoDB deployment by enabling TLS/SSL

--

Mlab (formerly Mongolab) is one of the most popular “MongoDB as a service” cloud providers.

IP whitelisting is available in Mlab for dedicated plans only, starting at $180. Sadly enough, this option is not available to sandbox or shared cluster plans.

Whether creating a new deployment or upgrading an existing deployment, you can enable SSL support for MongoDB connections directly from the mLab management portal.

Unfortunately, Mlab consider TLS encryption to be a “ premium offering” and SSL domains incur an additional monthly charge (currently $80).

Enabling SSL when creating a new deployment

If you are creating a new deployment, you can enable SSL by choosing a domain scope toward the bottom of the form. The option will only appear if you have chosen a Dedicated plan running MongoDB 2.6 or later.

Upgrading an existing deployment to enable SSL

If you have an existing deployment, you can enable SSL from the Tools tab for that deployment. The option will only appear if the deployment is subscribed to a Dedicated plan that was provisioned via mlab.com and running MongoDB 2.6 or later.

Before enabling SSL:

  • Make sure your deployment is running MongoDB 2.6 or later; follow these instructions to change versions

When you’re ready to enable SSL, follow these steps:

  1. Log in to the mLab management portal
  2. From your account’s Home page, navigate to the deployment that will be modified
  3. Click the “Tools” tab
  4. Select the desired domain scope in the drop-down menu that appears in the “Enable SSL” section
  5. Click the “Enable SSL” button
  6. Wait for the upgrade process to complete
  7. Update your driver configuration to connect over SSL, keeping in mind that the DNS names in your connection string have likely been changed to use your chosen SSL domain scope

--

--