> This page location: /docs.md > /docs/management.md > /docs/manual/core/self-managed-security.md > /docs/manual/core/security-hardening.md > /docs/manual/core/security-transport-encryption.md

> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

<!--
Tab options on this page. Append to the .md URL to filter:
  ?tabs=<id,...>   select specific tabs (e.g. ?tabs=nodejs,shell)
  ?allTabs=true    include every tab
  (no param)       default: one tab per tabset

Available tabs:
  other tabs: linux-fips-config, windows-fips-config, macos-fips-config
-->

# Configure MongoDB for FIPS

## Overview

The Federal Information Processing Standard (FIPS) is a U.S. government computer security standard used to certify software modules and libraries that encrypt and decrypt data securely.  You can configure MongoDB to run with a FIPS 140-2 certified library for OpenSSL. Configure FIPS to run by default or as needed from the command line.

A full description of FIPS and TLS/SSL is beyond the scope of this document. This tutorial assumes prior knowledge of FIPS and TLS/SSL.

**Important: MongoDB and FIPS**

FIPS is a property of the encryption system and not the access control system. However, if your environment requires FIPS compliant encryption *and* access control, you must ensure that the access control system uses only FIPS-compliant encryption.

MongoDB's FIPS support covers the way that MongoDB uses SSL/TLS libraries for network encryption, SCRAM authentication, and X.509 authentication. If you use Kerberos or LDAP authentication, you must ensure that these external mechanisms are FIPS-compliant.

**Note:**

MongoDB disables support for TLS 1.0 and TLS 1.1 encryption on systems where TLS 1.2+ is available.

## Platform Support

FIPS mode is only available with [MongoDB Enterprise](http://www.mongodb.com/products/mongodb-enterprise-advanced) edition. See [Install MongoDB Enterprise on Linux, macOS, and Windows](https://www.mongodb.com/docs/manual/administration/install-enterprise.md) to download and install [MongoDB Enterprise.](http://www.mongodb.com/products/mongodb-enterprise-advanced)

FIPS mode is supported on the following platforms:

| Platform | TLS/SSL library |
| --- | --- |
| Linux | OpenSSL |
| Windows | Secure Channel (SChannel) |
| macOS | Secure Transport |

## OpenSSL3 Support

Starting in MongoDB 6.0.7, FIPS mode supports [OpenSSL3](https://www.openssl.org/docs/man3.0/man7/migration_guide.html) for the following operating systems:

- Ubuntu 22.04

- RHEL 9

- Amazon Linux 2023

Starting in MongoDB 8.0, FIPS mode supports OpenSSL3 for Amazon Linux 2023.3.

## Configuring FIPS

Select the tab below for your platform:

### Linux

### Prerequisites

Your Linux system must have an OpenSSL library configured with the FIPS 140-2 module in order to support FIPS mode for MongoDB.

- Verify that your OpenSSL software includes FIPS support by running the following command:

  ```bash
  openssl version
  ```

- For Red Hat Enterprise Linux 6.x (RHEL 6.x) or its derivatives such as CentOS 6.x, the OpenSSL toolkit must be at least version `openssl-1.0.1e-16.el6_5` to use FIPS mode. To upgrade the OpenSSL library on these platforms, run the following command:

  ```bash
  sudo yum update openssl
  ```

- Some versions of Linux periodically execute a process to prelink dynamic libraries with pre-assigned addresses. This process modifies the OpenSSL libraries, specifically `libcrypto`. The OpenSSL FIPS mode will subsequently fail the signature check performed upon startup to ensure `libcrypto` has not been modified since compilation.

  To configure the Linux prelink process to not prelink `libcrypto`, run the following command:

  ```bash
  sudo bash -c "echo '-b /usr/lib64/libcrypto.so.*' >>/etc/prelink.conf.d/openssl-prelink.conf"
  ```

Once you have configured your Linux system to support FIPS-compliant operation, follow the steps below to configure your [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) or [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos) instance to operate in FIPS mode.

### Procedure

#### A. Configure MongoDB to use TLS/SSL

See [Configure MongoDB Instances for TLS/SSL Encryption](https://www.mongodb.com/docs/manual/tutorial/configure-ssl.md) for details about configuring your deployment to use TLS/SSL. Ensure that your certificate is FIPS-compliant.

#### B. Run MongoDB instance in FIPS mode

Perform these steps after you [Configure MongoDB Instances for TLS/SSL Encryption.](https://www.mongodb.com/docs/manual/tutorial/configure-ssl.md)

1. Change configuration file.

   To configure your [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) or [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos) instance to use FIPS mode, shut down the instance and update the configuration file with the [`net.tls.FIPSMode`](https://www.mongodb.com/docs/manual/reference/configuration-options.md#mongodb-setting-net.tls.FIPSMode) setting:

   ```yaml
   net:
      tls:
         FIPSMode: true
   ```

2. Start [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) or [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos) instance with configuration file.

   For example, run this command to start the  [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance with its configuration file:

   ```javascript
   mongod --config /etc/mongod.conf

   ```

#### C. Confirm that FIPS mode is running

Check the server log file for a message that FIPS is active:

```bash
FIPS 140-2 mode activated
```

## Additional Considerations

### SCRAM SHA and FIPS Mode

Starting in MongoDB 5.1, instances running in [FIPS mode](https://www.mongodb.com/docs/manual/tutorial/configure-fips.md#std-label-fips-overview) have the [SCRAM-SHA-1 authentication mechanism](https://www.mongodb.com/docs/manual/reference/parameters.md#std-label-authentication-parameters) disabled by default. You can enable the [SCRAM-SHA-1 authentication mechanism](https://www.mongodb.com/docs/manual/reference/parameters.md#std-label-authentication-parameters) with the [setParameter.authenticationMechanisms](https://www.mongodb.com/docs/manual/reference/parameters.md#std-label-set-parameter-authenticationMechanisms-code) command.

This change will not affect drivers which target MongoDB [`setFeatureCompatibilityVersion`](https://www.mongodb.com/docs/manual/reference/command/setfeaturecompatibilityversion.md#mongodb-dbcommand-dbcmd.setFeatureCompatibilityVersion) 4.0+.

Starting in MongoDB 8.3, you cannot specify `SCRAM-SHA-1` for [`authenticationMechanisms`](https://www.mongodb.com/docs/manual/reference/parameters.md#mongodb-parameter-param.authenticationMechanisms) while also specifying [`mongod --tlsFIPSMode`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#std-option-mongod.--tlsFIPSMode) or [`mongos --tlsFIPSMode`.](https://www.mongodb.com/docs/manual/reference/program/mongos.md#std-option-mongos.--tlsFIPSMode)

If you try to specify `SCRAM-SHA-1` for `authenticationMechanisms` while also specifying `--tlsFIPSMode`, the server throws an error and logs a message similar to the following:

```none
SCRAM-SHA-1 is not allowed in FIPS mode.
```

If you use [SCRAM-SHA-1:](https://www.mongodb.com/docs/manual/reference/parameters.md#std-label-authentication-parameters)

- [md5](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-md5) is necessary but is not used for cryptographic purposes, and

- if you use [FIPS mode](https://www.mongodb.com/docs/manual/tutorial/configure-fips.md#std-label-fips-overview), then instead of [SCRAM-SHA-1](https://www.mongodb.com/docs/manual/reference/parameters.md#std-label-authentication-parameters) use:

  - [SCRAM-SHA-256,](https://www.mongodb.com/docs/manual/core/security-scram.md#std-label-authentication-scram)

  - [Kerberos,](https://www.mongodb.com/docs/manual/core/kerberos.md#std-label-security-kerberos)

  - [LDAP](https://www.mongodb.com/docs/manual/core/security-ldap.md#std-label-security-ldap), or

  - [X.509](https://www.mongodb.com/docs/manual/core/security-x.509.md#std-label-security-auth-x509)

### `mongod`, `mongos`, and FIPS Mode

If you configure [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) and [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos) to use FIPS mode, `mongod` and `mongos` use FIPS-compliant connections.

### Database Tools and FIPS Mode

The following programs no longer support the `--sslFIPSMode` option:

- [`mongodump`](https://www.mongodb.com/docs/database-tools/mongodump.md#mongodb-binary-bin.mongodump)

- [`mongoexport`](https://www.mongodb.com/docs/database-tools/mongoexport.md#mongodb-binary-bin.mongoexport)

- [`mongofiles`](https://www.mongodb.com/docs/database-tools/mongofiles.md#mongodb-binary-bin.mongofiles)

- [`mongoimport`](https://www.mongodb.com/docs/database-tools/mongoimport.md#mongodb-binary-bin.mongoimport)

- [`mongorestore`](https://www.mongodb.com/docs/database-tools/mongorestore.md#mongodb-binary-bin.mongorestore)

- [`mongostat`](https://www.mongodb.com/docs/database-tools/mongostat.md#mongodb-binary-bin.mongostat)

- [`mongotop`](https://www.mongodb.com/docs/database-tools/mongotop.md#mongodb-binary-bin.mongotop)

If you configure [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) and [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos) to use FIPS mode, the preceding database tools use FIPS-compliant connections automatically.

### MongoDB Shell and FIPS Mode

The default [`mongosh`](https://www.mongodb.com/docs/mongodb-shell.md#mongodb-binary-bin.mongosh) distribution:

- Contains OpenSSL 3.

- Uses FIPS-compliant connections to [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) and [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos) if you configure `mongod` and `mongos` to use FIPS mode.

MongoDB also provides a MongoDB Shell distribution that can use:

- OpenSSL 1.1 and OpenSSL 3 installed on your server.

- `--tlsFIPSMode` option, which enables the `mongosh` FIPS mode.

**See also:**

- To download MongoDB Shell distributions that contain OpenSSL 1.1 and OpenSSL 3, go to the [MongoDB Download Center.](https://www.mongodb.com/try/download/shell)

- [Install mongosh](https://www.mongodb.com/docs/mongodb-shell/install.md#std-label-mdb-shell-install)
