# MongoDBTlsMode

- Kind: `enum`
- Package: [Aspire.Hosting.MongoDB](/reference/api/csharp/aspire.hosting.mongodb.md)
- Version: `13.6.0`
- Namespace: `Aspire.Hosting`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/f4c27f2d43ddc1cacd0dd083b30d1fea1cee7a62/src/Aspire.Hosting.MongoDB/MongoDBTlsMode.cs)

Defines the TLS mode for MongoDB server.

## Definition

```csharp
namespace Aspire.Hosting;

public enum MongoDBTlsMode
```

## Remarks

See https://www.mongodb.com/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.mode

## Enum Members

| Name | Value | Description |
| --- | --- | --- |
| AllowTls | 0 | Connections between servers do not use TLS. For incoming connections, the server accepts both TLS and non-TLS. |
| PreferTls | 1 | Connections between servers use TLS. For incoming connections, the server accepts both TLS and non-TLS. |
| RequireTls | 2 | The server uses and accepts only TLS encrypted connections. |
