Using the default certificate may pose security risks. To improve system security, you are advised to periodically change the certificate to prevent password cracking. If you need to replace the certificate, contact the database customer service.
For more information about SSL certificates, see (Optional) Downloading the SSL Certificate. The following parts are included in this section:
After a data warehouse cluster is deployed, the SSL authentication mode is enabled by default. The server certificate, private key, and root certificate have been configured by default. You need to configure the client parameters.
For more information about SSL certificates, see (Optional) Downloading the SSL Certificate.
For example, save the downloaded certificate dws_ssl_cert.zip to the /home/dbadmin/dws_ssl/ directory.
cd /home/dbadmin/dws_ssl/ unzip dws_ssl_cert.zip
There are two SSL authentication modes: bidirectional authentication and unidirectional authentication. Different authentication modes require different client environment variables. For details, see SSL Authentication Modes and Client Parameters.
The following parameters must be configured for bidirectional authentication:
export PGSSLCERT="/home/dbadmin/dws_ssl/sslcert/client.crt" export PGSSLKEY="/home/dbadmin/dws_ssl/sslcert/client.key" export PGSSLMODE="verify-ca" export PGSSLROOTCERT="/home/dbadmin/dws_ssl/sslcert/cacert.pem"
The following parameters must be configured for unidirectional authentication:
export PGSSLMODE="verify-ca" export PGSSLROOTCERT="/home/dbadmin/dws_ssl/sslcert/cacert.pem"
The permissions on the client's root certificate, private key, certificate, and encrypted private key file must be 600. If the permissions do not meet the requirement, the client cannot connect to the cluster in SSL mode.
chmod 600 client.key chmod 600 client.crt chmod 600 client.key.cipher chmod 600 client.key.rand chmod 600 cacert.pem
There are two SSL authentication modes: bidirectional authentication and unidirectional authentication. Table Table 1 shows the differences between these two modes. You are advised to use bidirectional authentication for security purposes.
Authentication Mode |
Description |
Environment Variables Configured on a Client |
Maintenance |
---|---|---|---|
Bidirectional authentication (recommended) |
The client verifies the server's certificate and the server verifies the client's certificate. The connection can be set up only after the verifications are successful. |
Set the following environment variables:
|
This authentication mode is applicable to scenarios that require high data security. When using this mode, you are advised to set the PGSSLMODE client variable to verify-ca for network data security purposes. |
Unidirectional authentication |
The client verifies the server's certificate, whereas the server does not verify the client's certificate. The server loads the certificate information and sends it to the client. The client verifies the server's certificate according to the root certificate. |
Set the following environment variables:
|
To prevent TCP-based link spoofing, you are advised to use the SSL certificate authentication. In addition to configuring the client root certificate, you are advised to set the PGSSLMODE variable to verify-ca on the client. |
Configure environment variables related to SSL authentication on the client. For details, see Table 2.
The path of environment variables is set to /home/dbadmin/dws_ssl/ as an example. Replace it with the actual path.
Environment Variable |
Description |
Value Range |
---|---|---|
PGSSLCERT |
Specifies the certificate files for a client, including the public key. Certificates prove the legal identity of the client and the public key is sent to the remote end for data encryption. |
The absolute path of the files must be specified, for example:
export PGSSLCERT='/home/dbadmin/dws_ssl/sslcert/client.crt' (No default value) |
PGSSLKEY |
Specifies the client private key file used to decrypt the digital signatures and the data encrypted using the public key. |
The absolute path of the files must be specified, for example:
export PGSSLKEY='/home/dbadmin/dws_ssl/sslcert/client.key' (No default value) |
PGSSLMODE |
Specifies whether to negotiate with the server about SSL connection and specifies the priority of the SSL connection. |
Values and meanings:
Default value: prefer |
PGSSLROOTCERT |
Specifies the root certificate file for issuing client certificates. The root certificate is used to verify the server certificate. |
The absolute path of the files must be specified, for example:
export PGSSLROOTCERT='/home/dbadmin/dws_ssl/sslcert/certca.pem' Default value: null |
PGSSLCRL |
Specifies the certificate revocation list file, which is used to check whether a server certificate is in the list. If the certificate is in the list, it is invalid. |
The absolute path of the files must be specified, for example:
export PGSSLCRL='/home/dbadmin/dws_ssl/sslcert/sslcrl-file.crl' Default value: null |