# Google Cloud Network Security V1 Client - Class MTLSPolicy (1.4.0)

1.4.0 (latest) 1.3.0 1.2.3 1.1.0 1.0.4 0.6.5 0.5.2 0.4.1 0.3.7 Reference documentation and code samples for the Google Cloud Network Security V1 Client class MTLSPolicy.

Specification of the MTLSPolicy.

Generated from protobuf message `google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy`

## Namespace

Google \\ Cloud \\ NetworkSecurity \\ V1 \\ ServerTlsPolicy

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ client_validation_mode` | `int` When the client presents an invalid certificate or no certificate to the load balancer, the `client_validation_mode` specifies how the client connection is handled. Required if the policy is to be used with the Application Load Balancers. For Traffic Director it must be empty. |
| `↳ client_validation_ca` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.ValidationCA>` Required if the policy is to be used with Traffic Director. For Application Load Balancers it must be empty. Defines the mechanism to obtain the Certificate Authority certificate to validate the client certificate. |
| `↳ client_validation_trust_config` | `string` Reference to the TrustConfig from certificatemanager.googleapis.com namespace. If specified, the chain validation will be performed against certificates configured in the given TrustConfig. Allowed only if the policy is to be used with Application Load Balancers. |

### getClientValidationMode

When the client presents an invalid certificate or no certificate to the
load balancer, the `client_validation_mode` specifies how the client
connection is handled.

Required if the policy is to be used with the Application Load
Balancers. For Traffic Director it must be empty.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [ClientValidationMode](https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.ServerTlsPolicy.MTLSPolicy.ClientValidationMode). |

### setClientValidationMode

When the client presents an invalid certificate or no certificate to the
load balancer, the `client_validation_mode` specifies how the client
connection is handled.

Required if the policy is to be used with the Application Load
Balancers. For Traffic Director it must be empty.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [ClientValidationMode](https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.ServerTlsPolicy.MTLSPolicy.ClientValidationMode). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getClientValidationCa

Required if the policy is to be used with Traffic Director. For
Application Load Balancers it must be empty.

Defines the mechanism to obtain the Certificate Authority certificate to
validate the client certificate.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.ValidationCA>` |   |

### setClientValidationCa

Required if the policy is to be used with Traffic Director. For
Application Load Balancers it must be empty.

Defines the mechanism to obtain the Certificate Authority certificate to
validate the client certificate.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.ValidationCA>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getClientValidationTrustConfig

Reference to the TrustConfig from certificatemanager.googleapis.com
namespace.

If specified, the chain validation will be performed against certificates
configured in the given TrustConfig.
Allowed only if the policy is to be used with Application Load
Balancers.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setClientValidationTrustConfig

Reference to the TrustConfig from certificatemanager.googleapis.com
namespace.

If specified, the chain validation will be performed against certificates
configured in the given TrustConfig.
Allowed only if the policy is to be used with Application Load
Balancers.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |