Contents
PostgreSQL Databases
You must make PostgreSQL client software accessible in the environment where the Genesys application is running. Genesys uses PostgreSQL 9.0 client software to access all supported versions of PostgreSQL.
Using PostgreSQL Client Software
The vendor client software must be in the folder specified in the environment variable PATH (for Windows), LIBPATH (for AIX), or LD_LIBRARY_PATH (for Linux and Solaris). Refer to PostgreSQL documentation for more information.
The following is an example of the configuration of Genesys Database Access Point parameters for PostgreSQL:
dbengine=postgre
dbserver=<postgresql server host>
dbname=<database name>
username=<user name>
password=<password>Connectivity to PostgreSQL relies on TCP/IP between server and client. PostgreSQL client software uses operating system settings for the TCP/IP stack to determine how long to wait for a response form the PostgreSQL server after submitting a request to it. For example, on Linux it may take up to two hours to detect a disconnection, unless the Operating System parameter tcp_keepalive_time is adjusted. Refer to documentation for your operating system for more information.
PostgreSQL Strings
When using PostgreSQL Server 9.2 or higher, make sure the following parameters are set in the postgresql.conf file, as follows:
bytea_output =’escape’
standard_conforming_strings=’off’Secure Connections with PostgreSQL DBMS
You can use TLS via OpenSSL to secure connections to PostgreSQL databases.
A secure connection to a PostgreSQL database is required to set up and use SSL. OpenSSL must be installed on both the client and the server systems. This section describes how to configure the connection and enable SSL on both the PostgreSQL server and the database client. Note that the configuration steps given in this section are supported only by PostgreSQL Server version 9.2 and above.
The default directories, from which the client and server obtain their certificates, can be overridden by setting appropriate configuration options. The default directories are:
- Client: (if necessary, create the folder)
- Linux platform: ~/.postgresql/
- Windows platform: %APPDATA%\postgresql\
- Server:
- Postgre SQL Server's data directory
On PostgreSQL Server
To enable SSL on the PostgreSQL server, set the parameter ssl to on in the postgresql.conf configuration file. This enables the server to listen for both normal and SSL connections on the same TCP port, based on the options specified by client.
On UNIX systems, the permissions of server.key must not allow any access to the world or group. You can achieve this by issuing the following command:
chmod 0600 server.keyIf the private key is protected by a passphrase, the server will prompt for the passphrase and will not start until the correct passphrase is entered.
To start in SSL mode, files containing the server certificate and private key must exist and be available. By default, these files are expected to be named server.crt and server.key, and are located in the PostgreSQL Server's data directory. If you are using other names and locations, specify them in postgresql.conf with the parameters ssl_cert_file and ssl_key_file, respectively. You can use relative or absolute paths, but all relative paths must be relative to the server's data directory.
If you are using mutual TLS, you need to verify the client's trusted certificate. Put all Certificate Authorities (CAs) in a single file, such as root.crt, and put that file in the PostgreSQL server's data directory. In the postgresql.conf file, set the parameter ssl_ca_file to the name, and path if appropriate, of the CA file.
The following is an example of settings in the postgresql.conf file.
ssl = on
#ssl_ciphers = 'DEFAULT:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers
#ssl_renegotiation_limit = 512MB # amount of data between renegotiations
ssl_cert_file = 'WIN-VI3D4A69M8O.crt'
ssl_key_file = 'WIN-VI3D4A69M8O.key'
ssl_ca_file = 'cert_authority.crt'
#ssl_crl_file =Notes:
- Hash symbols (#) indicate comments in the file, or lines that are currently not read by the system.
- A change in any of the parameters except ssl_renegotiation_limit requires a restart to take effect.
The parameters in the file are described in the following table.
[+] Show tableIn the authentication configuration file (pg_hba.conf located in the server's data directory), configure records that support SSL, using one of the following methods:
- host database user address auth-method [auth-options]
This record matches connection attempts made using TCP/IP, and match either SSL or non-SSL connection attempts. - hostssl database user address auth-method [auth-options]
This record matches connection attempts made using TCP/IP, but only when the connection is made with SSL encryption. If you are using mutual TLS, add clientcert=1 at the end of this line to require the clinet to supply a trusted certificate.
The clientcert option in pg_hba.conf is available for all authentication methods, but only for rows specified as hostssl. When clientcert is not specified or is set to 0, the PostgreSQL server will still verify any client certificates presented to it against its own CA or CA list, but it will not insist or expect a client certificate to be presented.
The following is an example of the settings in the pg_hba.conf file:
[+] Show exampleOn PostgreSQL Client
To configure a secure connection on a PostgreSQL client, you must first enable the SSL connection by setting the sslmode option on the client. Set this option to one of the following values:
[+] Show valuesFor a mutual TLS connection, the server requests a trusted client certificate, which must be signed by a CA trusted by the server. A matching private key file must also be available.
Using Secure Connections to PostgreSQL Databases
If the Postgre SQL server is enabled for SSL connection, a Genesys Application can enable or disable it by using the appropriate environment variables described in this section.
[+] Show variablesError Messages:
The following table lists the various error messages that you might encounter when setting up and using a secure connection to a PostgreSQL database.
[+] Show messagesAdvanced Authentication methods with Postgre SQL DBMS
Genesys software supports the following PostgreSQL authentication methods:
- Password authentication over a plain TCP or TLS connection
- Certificate authentication This method is supported only when the connection is secured using SSL.
Password Authentication Through TCP/IP
Password authentication can be carried out over a plain (unsecured) TCP connection, or a secured TLS connection.
When SSL is enabled on both the server and client side, the encrypted or unencrypted password will be sent over a secure connection (TLS). When establishing the secure connection, you must follow basic rules of secure connection, such as:
- Server and Client machines must each have a CA that is able to verify certificates from the other machine.
- Certificate CNs should match the Host Name of the machine on which each certificate is installed.
Passwords can be authenticated using one of the following methods in PostgreSQL server:
- md5—An encrypted password is passed over the network.
- password—An unencrypted password is passed over the network.
Another related method, trust, does not pass any password over the network. In other words, it allows the client to log in without any authentication.
Methods are specified in the pg_hba.conf file. For example:
host all all 172.24.128.47/32 md5
hostssl configdb postgres 10.31.0.50/32 password
host all all 127.0.0.1/32 trustCertificate Authentication Through Secured TCP/IP connection
Instead of passing a password over the network, use this method to perform authentication over the secure connection with the same certificates.This authentication method uses SSL client certificates to perform authentication, and is therefore available only for SSL connections. When using this method, the server requires that the client provide a valid certificate. No password prompt is sent to the client.
Before using this method, you must set PGAUTH=cert.
This method compares the CN attribute of the certificate to the requested database user name, and if they match, the login is allowed. For example:
hostssl configdb postgres 10.31.0.50/32 certIf you are using mutual TLS, you must provide a client certificate and a key file. The username and the CN of the certificate should match. However, if you want to allow the situation in which the certificate's CN is different from the requested database user name, you can use what is called username mapping, with which you map the CN name to the requested PostgreSQL username using the pg_ident.conf file, as follows:
In the pg_hba.conf file, use the map option to set a map name for the client connection, such as map=<mapname>. For example:
hostssl configdb postgres 10.31.0.50/32 cert map=dbnameThen, in the pg_ident.conf, add the mapping information. For example:
# MAPNAME SYSTEM-USERNAME PG-USERNAME
dbname localuser postgreswhere:
- MAPNAME is the value of the map option in the pg_hba.conf.
- SYSTEM-USERNAME is the detected user name of the client from CN
- PG-USERNAME is the requested PostgreSQL user name.
Using PostgreSQL Databases with National Languages
Single Language Deployment
You must create all PostgreSQL databases using the same character set, for example WIN1252. You must select encoding that matches Microsoft Windows Operating System default encoding for the selected language so applications, like Interaction Routing Designer, display data correctly.
On every host that has Genesys applications accessing PostgreSQL databases, make sure that the language and encoding environment variable (or the settings for non-Unicode applications, if you are using Windows) is set to match character encoding of data in the PostgreSQL database. If there is a discrepancy between the encoding that the database and the local client are using, set the environment variable PGCLIENTENCODING on the host where the client software is running to match the database (for example, PGCLIENTENCODING=Win1252), based on the following table:
With the environment set up this way, you can use character data in a single language (such as French) for all information stored and transmitted between Genesys applications.
Multiple Languages Deployment
To enable storage and processing of data in multiple languages using a PostgreSQL database, you must create all your database instances using the UTF8 character set.
