# Google Cloud Network Security V1 Client - Class ServerTlsPolicy (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 ServerTlsPolicy.

ServerTlsPolicy is a resource that specifies how a server should authenticate
incoming requests. This resource itself does not affect configuration unless
it is attached to a target HTTPS proxy or endpoint config selector resource.

ServerTlsPolicy in the form accepted by Application Load Balancers can
be attached only to TargetHttpsProxy with an `EXTERNAL`, `EXTERNAL_MANAGED`
or `INTERNAL_MANAGED` load balancing scheme. Traffic Director compatible
ServerTlsPolicies can be attached to EndpointPolicy and TargetHttpsProxy with
Traffic Director `INTERNAL_SELF_MANAGED` load balancing scheme.

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

## Namespace

Google \\ Cloud \\ NetworkSecurity \\ V1

## Methods

### __construct

Constructor.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `data` | `mixed` |

### getName

Required. Name of the ServerTlsPolicy resource. It matches the pattern
`projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}`

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

### setName

Required. Name of the ServerTlsPolicy resource. It matches the pattern
`projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}`

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

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

### getDescription

Free-text description of the resource.

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

### setDescription

Free-text description of the resource.

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

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

### getCreateTime

Output only. The timestamp when the resource was created.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The timestamp when the resource was created.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getUpdateTime

Output only. The timestamp when the resource was updated.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The timestamp when the resource was updated.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getLabels

Set of label tags associated with the resource.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setLabels

Set of label tags associated with the resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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

### getAllowOpen

This field applies only for Traffic Director policies. It is must be set to
false for Application Load Balancer policies.

Determines if server allows plaintext connections. If set to true, server
allows plain text connections. By default, it is set to false. This setting
is not exclusive of other encryption modes. For example, if `allow_open`
and `mtls_policy` are set, server allows both plain text and mTLS
connections. See documentation of other encryption modes to confirm
compatibility.
Consider using it if you wish to upgrade in place your deployment to TLS
while having mixed TLS and non-TLS traffic reaching port :80.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setAllowOpen

This field applies only for Traffic Director policies. It is must be set to
false for Application Load Balancer policies.

Determines if server allows plaintext connections. If set to true, server
allows plain text connections. By default, it is set to false. This setting
is not exclusive of other encryption modes. For example, if `allow_open`
and `mtls_policy` are set, server allows both plain text and mTLS
connections. See documentation of other encryption modes to confirm
compatibility.
Consider using it if you wish to upgrade in place your deployment to TLS
while having mixed TLS and non-TLS traffic reaching port :80.

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

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

### getServerCertificate

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

Defines a mechanism to provision server identity (public and private keys).
Cannot be combined with `allow_open` as a permissive mode that allows both
plain text and TLS is not supported.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.CertificateProvider|null` |   |

### hasServerCertificate

### clearServerCertificate

### setServerCertificate

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

Defines a mechanism to provision server identity (public and private keys).
Cannot be combined with `allow_open` as a permissive mode that allows both
plain text and TLS is not supported.

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

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

### getMtlsPolicy

This field is required if the policy is used with Application Load
Balancers. This field can be empty for Traffic Director.

Defines a mechanism to provision peer validation certificates for peer to
peer authentication (Mutual TLS - mTLS). If not specified, client
certificate will not be requested. The connection is treated as TLS and not
mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
text and mTLS connections.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.ServerTlsPolicy.MTLSPolicy|null` |   |

### hasMtlsPolicy

### clearMtlsPolicy

### setMtlsPolicy

This field is required if the policy is used with Application Load
Balancers. This field can be empty for Traffic Director.

Defines a mechanism to provision peer validation certificates for peer to
peer authentication (Mutual TLS - mTLS). If not specified, client
certificate will not be requested. The connection is treated as TLS and not
mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
text and mTLS connections.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.ServerTlsPolicy.MTLSPolicy` |

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