Enable-NCacheTLS
The Enable-NCacheTLS PowerShell cmdlet enables TLS encryption for client-server, server-to-server (cluster), and Bridge communication on the specified NCache server nodes. By default, NCache provisions and renews the server certificate automatically. You can instead provide a PEM certificate through -CustomCertificatePath, or use -UseMutualTls to additionally require connecting clients to present valid certificates.
Enable-NCacheTLS [-Node] [-UseMutualTls] [-CustomCertificatePath] `
[-CustomCertificatePassword] [-ProtocolVersion] `
[-TlsCertPath] [-TlsCertPassword] `
[-Credentials] [-NoLogo]
Examples
- This command enables TLS on the local NCache server using an NCache-provided certificate. NCache automatically provisions and renews the server certificate and uses TLS 1.2 by default.
Enable-NCacheTLS
- This command enables TLS on server nodes
20.200.20.11and20.200.20.12. NCache provisions a separate server certificate for each node.
Enable-NCacheTLS -Node "20.200.20.11,20.200.20.12"
- This command enables TLS with mutual TLS for client connections on the specified nodes and allows the operating system to negotiate the supported TLS protocol by using
auto. Before enabling mutual TLS, generate or configure a valid client certificate for each connecting client.
Enable-NCacheTLS -Node "20.200.20.11,20.200.20.12" -UseMutualTls -ProtocolVersion auto
- This command enables TLS 1.3 on the specified server nodes by setting
-ProtocolVersiontotls13.
Enable-NCacheTLS -Node "20.200.20.11,20.200.20.12" -ProtocolVersion tls13
- This command enables TLS on the local server using a custom PEM certificate instead of an NCache-provided certificate. The PEM file must contain the private key, leaf certificate, and any Intermediate certificates in that order.
Enable-NCacheTLS -CustomCertificatePath "C:\certs\ncache-chain.pem"
- This command enables TLS on remote nodes when NCache security is enabled on the target servers.
Get-Credentialsupplies the credentials required to authorize the operation.
Enable-NCacheTLS -Node "20.200.20.11,20.200.20.12" -Credentials(Get-Credential john_smith)
- This command configures a custom PEM certificate with an encrypted server private key on node
20.200.20.11.
Enable-NCacheTLS -Node "20.200.20.11" `
-CustomCertificatePath "C:\certs\server.pem" `
-CustomCertificatePassword "serverKeyPassword"
- This command runs from a machine without an NCache server installation and connects to an mTLS-protected node using a password-protected client PEM. The
-CustomCertificate*parameters configure the server, while-TlsCert*authenticate this PowerShell connection.
Enable-NCacheTLS -Node "20.200.20.11" `
-CustomCertificatePath "C:\certs\server.pem" `
-CustomCertificatePassword "serverKeyPassword" `
-TlsCertPath "C:\certs\admin-client.pem" `
-TlsCertPassword "clientKeyPassword" -UseMutualTls
Properties
Note
All parameters for this cmdlet are optional. When -Node is omitted, TLS is configured on the local NCache server.
| Parameters | Data Types | Description | Default Value |
|---|---|---|---|
-Node |
<String> |
Specifies one or more NCache server IP addresses as a comma-separated list. Each specified server is configured over the management RPC channel. When omitted, TLS is enabled on the local server. | Local server |
-UseMutualTls |
<SwitchParameter> |
Requires every client connecting to the configured server to present a valid client certificate. Generate an NCache-signed client certificate with New-NCacheTlsCertificate, or configure a certificate issued by your own CA, before enabling this option. | False |
-CustomCertificatePath |
<String> |
Specifies the path to a PEM file that the server presents instead of the certificate NCache provisions automatically. The PEM file must contain the private key, leaf certificate, and any Intermediate certificates in that order. The path is written to tls.ncconf as provided and is not validated for file existence when the cmdlet runs. |
- |
-CustomCertificatePassword |
<String> |
Password for the encrypted private key in the PEM file specified by -CustomCertificatePath. Not needed for unencrypted keys. Saved in the <password> element of each target node's tls.ncconf; ignored if -CustomCertificatePath is omitted. |
- |
-TlsCertPath |
<String> |
Path to the client PEM certificate for authenticating the machine executing this cmdlet against a remote server already requiring mTLS. Required for that scenario when the machine does not have an NCache server installation; an NCache server installation can use its own certificate automatically. | - |
-TlsCertPassword |
<String> |
Password for an encrypted private key in -TlsCertPath. Used for the current command connection only and not saved in the server configuration. |
- |
-ProtocolVersion |
<String> |
Specifies the TLS protocol version to use. Supported values are tls12 for TLS 1.2, tls13 for TLS 1.3, and auto to let the operating system negotiate the highest mutually supported TLS version. The default value is tls12. |
tls12 |
-Credentials |
<pscredential> |
Specifies the credentials used to authorize the operation on remote nodes when NCache security is enabled. The credentials are encrypted before being sent over the management RPC channel. This parameter is not required when configuring the local server. | - |
-NoLogo |
<SwitchParameter> |
Suppresses display of the NCache logo banner. | False |