# SiloTlsHostingExtensions Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.runtime/orleans.hosting.silotlshostingextensions/)

## UseTls(ISiloBuilder, Action&lt;TlsOptions&gt;) {#usetls-this-orleans-hosting-isilobuilder-system-action-orleans-connections-trans-9e69de03}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.runtime/orleans.hosting.silotlshostingextensions/methods/usetls-this-orleans-hosting-isilobuilder-system-action-orleans-connections-trans-9e69de03/)

[Source](https://github.com/dotnet/orleans/blob/fbe240c34e9a1389ca5ab2d52f292ed8749ea530/src/Orleans.Runtime/Hosting/SiloTlsHostingExtensions.ISiloBuilder.cs#L102-L122)

```csharp
public static ISiloBuilder UseTls(this ISiloBuilder builder, Action<TlsOptions> configureOptions)
```

Configures TLS.

### Parameters

- `builder` (`ISiloBuilder`): The builder to configure.
- `configureOptions` (`Action<TlsOptions>`): An Action to configure the [TlsOptions](/orleans/docs/api/csharp/microsoft.orleans.core/orleans.connections.transport.security.tlsoptions/).

### Returns

The builder.

## UseTls(ISiloBuilder, StoreName, string, bool, StoreLocation, Action&lt;TlsOptions&gt;) {#usetls-this-orleans-hosting-isilobuilder-system-security-cryptography-x509certif-312f813d}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.runtime/orleans.hosting.silotlshostingextensions/methods/usetls-this-orleans-hosting-isilobuilder-system-security-cryptography-x509certif-312f813d/)

[Source](https://github.com/dotnet/orleans/blob/fbe240c34e9a1389ca5ab2d52f292ed8749ea530/src/Orleans.Runtime/Hosting/SiloTlsHostingExtensions.ISiloBuilder.cs#L34-L38)

```csharp
public static ISiloBuilder UseTls(this ISiloBuilder builder, StoreName storeName, string subject, bool allowInvalid, StoreLocation location, Action<TlsOptions> configureOptions)
```

Configures TLS.

### Parameters

- `builder` (`ISiloBuilder`): The builder to configure.
- `storeName` (`StoreName`): The certificate store to load the certificate from.
- `subject` (`string`): The subject name for the certificate to load.
- `allowInvalid` (`bool`): Indicates if invalid certificates should be considered, such as self-signed certificates.
- `location` (`StoreLocation`): The store location to load the certificate from.
- `configureOptions` (`Action<TlsOptions>`): An Action to configure the [TlsOptions](/orleans/docs/api/csharp/microsoft.orleans.core/orleans.connections.transport.security.tlsoptions/).

### Returns

The builder.

## UseTls(ISiloBuilder, X509Certificate2) {#usetls-this-orleans-hosting-isilobuilder-system-security-cryptography-x509certif-d9049110}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.runtime/orleans.hosting.silotlshostingextensions/methods/usetls-this-orleans-hosting-isilobuilder-system-security-cryptography-x509certif-d9049110/)

[Source](https://github.com/dotnet/orleans/blob/fbe240c34e9a1389ca5ab2d52f292ed8749ea530/src/Orleans.Runtime/Hosting/SiloTlsHostingExtensions.ISiloBuilder.cs#L79-L89)

```csharp
public static ISiloBuilder UseTls(this ISiloBuilder builder, X509Certificate2 certificate)
```

Configures TLS.

### Parameters

- `builder` (`ISiloBuilder`): The builder to configure.
- `certificate` (`X509Certificate2`): The server certificate.

### Returns

The builder.

## UseTls(ISiloBuilder, X509Certificate2, Action&lt;TlsOptions&gt;) {#usetls-this-orleans-hosting-isilobuilder-system-security-cryptography-x509certif-2c386f1b}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.runtime/orleans.hosting.silotlshostingextensions/methods/usetls-this-orleans-hosting-isilobuilder-system-security-cryptography-x509certif-2c386f1b/)

[Source](https://github.com/dotnet/orleans/blob/fbe240c34e9a1389ca5ab2d52f292ed8749ea530/src/Orleans.Runtime/Hosting/SiloTlsHostingExtensions.ISiloBuilder.cs#L53-L66)

```csharp
public static ISiloBuilder UseTls(this ISiloBuilder builder, X509Certificate2 certificate, Action<TlsOptions> configureOptions)
```

Configures TLS.

### Parameters

- `builder` (`ISiloBuilder`): The builder to configure.
- `certificate` (`X509Certificate2`): The server certificate.
- `configureOptions` (`Action<TlsOptions>`): An Action to configure the [TlsOptions](/orleans/docs/api/csharp/microsoft.orleans.core/orleans.connections.transport.security.tlsoptions/).

### Returns

The builder.
